Author Topic: Bug: Alt+Up/Down moves an extra line  (Read 3892 times)

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Bug: Alt+Up/Down moves an extra line
« 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). But reading the answer Neil gave me, seems like it could actually be related to Code::Blocks.

 

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Bug: Alt+Up/Down moves an extra line
« Reply #1 on: December 23, 2013, 10:03:24 am »
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Bug: Alt+Up/Down moves an extra line
« Reply #2 on: December 23, 2013, 10:15:17 am »
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 ?

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Re: Bug: Alt+Up/Down moves an extra line
« Reply #3 on: December 23, 2013, 12:37:38 pm »
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Bug: Alt+Up/Down moves an extra line
« Reply #4 on: December 23, 2013, 12:42:46 pm »
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 ?

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Re: Bug: Alt+Up/Down moves an extra line
« Reply #5 on: December 23, 2013, 12:51:25 pm »
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 ;)

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Re: Bug: Alt+Up/Down moves an extra line
« Reply #6 on: December 23, 2013, 12:55:31 pm »
BTW: I just noticed, that trick to distinguish both cases will not work if selection is done from bottom upwards