Select All when lines are hidden doesn't always select all #484

Closed
opened 2012-04-05 08:59:06 +02:00 by marijnh · 2 comments
marijnh commented 2012-04-05 08:59:06 +02:00 (Migrated from gitlab.com)
  1. Download https://gist.github.com/2308587 and put the current codemirror.css/codemirror.js next to it
  2. Click at the end of the unhidden line
  3. Hit Ctrl/Cmd-A to select all

Result: Last two letters aren't selected. Seems to have something to do with the way selection is fixed up--it selects the whole document, then fixes up the selection across the hidden lines, but maintains the character position of the last character in the document (which is smaller than the last character position in the last unhidden line).

1. Download https://gist.github.com/2308587 and put the current codemirror.css/codemirror.js next to it 2. Click at the end of the unhidden line 3. Hit Ctrl/Cmd-A to select all Result: Last two letters aren't selected. Seems to have something to do with the way selection is fixed up--it selects the whole document, then fixes up the selection across the hidden lines, but maintains the character position of the last character in the document (which is smaller than the last character position in the last unhidden line).
marijnh commented 2012-04-05 09:02:29 +02:00 (Migrated from gitlab.com)

I started looking at fixing this by making it so that when skipHidden() is going upward, it resets the character to the end of the line that it lands on. But the existing heuristic depends on the previous selection, and I wasn't sure how that should interact with this. (In the "Select All" case, it probably should just ignore the previous selection.)

I started looking at fixing this by making it so that when skipHidden() is going upward, it resets the character to the end of the line that it lands on. But the existing heuristic depends on the previous selection, and I wasn't sure how that should interact with this. (In the "Select All" case, it probably should just ignore the previous selection.)
marijnh commented 2012-04-05 09:56:08 +02:00 (Migrated from gitlab.com)

BTW, this isn't super urgent for us...if you felt like working on one of our bugs over the next couple days I'd be much more interested in #483 :)

BTW, this isn't super urgent for us...if you felt like working on one of our bugs over the next couple days I'd be much more interested in #483 :)
marijnh (Migrated from gitlab.com) closed this issue 2012-04-17 14:57:33 +02:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#484
No description provided.