#2360·cryptpad

CodeMirror line numbers are user-selectable

Author: ansuzCreated Aug 12, 2026Updated Sep 7, 2026
LabelsCodeUI/UX

Description

As shown in the screenshot below, selecting text in CodeMirror also selects the line numbers in the gutter. I'm pretty sure this is a recent regression, but I haven't rolled back my instance to identify exactly when it was introduced.

Image

When copying the selected text, the line numbers are not included in the clipboard, so it's strictly a visual issue and does not otherwise interfere with editing.

I added the following rule with my browser's developer tools and can confirm that this addressed the issue, but there are many source files where this could be added and I'm not sure which option the team would prefer.

css
.CodeMirror-linenumber {
  user-select: none;
}

Steps to reproduce

  1. Open the code editor
  2. enter some text
  3. select that text
  4. observe that the line numbers are also selected

Relevant logs

bash

Expected behavior

CodeMirror's line numbers should not be highlighted.

Which operating system are you using?

Linux/BSD/UNIX

What browsers are you seeing the problem on?

Mozilla Firefox

Extensions

tested in a private browser with no extensions

Version

2026.5.1