Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: carra on December 23, 2013, 09:11:15 am
-
When using Alt+Up/Down to move more than one line, and the next (unselected) line is empty, the empty line is moved too. I have verified this bug both in svn 9455 and 8242.
I originally thought this would be a Scintilla bug, so I submitted it there (see here (http://sourceforge.net/p/scintilla/bugs/1566/)). But reading the answer Neil gave me, seems like it could actually be related to Code::Blocks.
-
It works correctly here, if the cursor (caret) is not in the empty line.
If it is there (if you selected top->down) it will also be moved, because teh last selection position is in this (empty) line, so I would say the behaviour is correct, even if it seems not to be obvious at first look.
-
But after reading your post more carefully, I see the inconsistency in behaviour, whether the last line (where the caret is at first pos) is empty or not.
But how to decide if an empty line should be selected or not, if the caret is at the first and therefore also last position ?
-
I'm not aware of the internal handling of an empty line, what you say may make sense. However from a user point of view, having an non-selected part move is unexpected.
I've tried the same in other editors (such as Eclipse) and so far I've never had any unselected line move, so that's why I saw it as a bug.
-
I see that is unexpected, but again my question, how to decide, whether the line is selected, if it contains no characters and the caret is in it ?
-
I have attached a screenshot of the 2 cases in C::B svn 9455.
If you look closely, when the line is selected the caret is actually on the NEXT line ;)
-
BTW: I just noticed, that trick to distinguish both cases will not work if selection is done from bottom upwards