Sublime Forum

Bug? Status bar reports show wrong number of selected lines

#1

Hi, in Build 3059 on Windows, when I select text, the status bar reports wrong number of selected lines - counts one line more.

This happens when after selection the cursor automatically jumps to the next line, even if it is an empty line or when there is nothing selected (e.g. when using CTRL+L). Hit CTRL+L just once and you will have instantly reported 2 lines selected (and + 1 character).

Same goes if your cursor originated from the beginning of previous line (e.g. using Shift+UP)

If you are careful with your mouse you can get the correct number but I think this behaviour is rather confusing…

Thanks for looking into this,
Athelas

Screens:
https://dl.dropboxusercontent.com/u/3111507/sublimestatusbar.png
https://dl.dropboxusercontent.com/u/3111507/sublimestatusbar2.png

0 Likes

#2

Imho the count is correct: as far as the caret is on the last line (or the first if you select lines upward),
then the status bar reports what you expect in your example, so 4 lines , if the caret is on the very next line after the selection (or the very previous one…), then it shows 5 lines as you said… but technically there is 1 more row… the one with the caret :wink:

…just my 2 cents

0 Likes

#3

This issue persists in Build 3126.

In my opinion, the original poster was correct. It’s intuitively wrong to provide a ‘select line’ command and have the result appear as 2 lines in the status bar. The issue here is that ST3 moves the cursor to the following line when ctrl-L is typed, regardless of the cursor’s starting position. This seems wrong to me.

In Vim, if I select a line (using V to enter Visual line mode, the common way to select the current line), Vim reports 1 line selected. if I move up or down, lines are added / removed appropriately.

Someone will no doubt point out to me that Vim is a modal editor: I don’t think this changes the fact that any reasonable user would expect ‘Expand Selection to Line’ (the command name shown in the menu) to do exactly that, and not move the cursor beyond the end of the line.

1 Like