Sublime Forum

Text disappears - is this a bug?

#1

I can move selected text some lines up and down using ctrl+shift+up/down.

If the last line ends with text and the selection contains an empty line at the end; it disappears after I moved it beyond the last line.

is%20this%20a%20bug%3F

1 Like

#2
2 Likes

#3

the behaviour is different. In the case of the issue the file ends with an empty line, making it impossible to swap the last and penultimate lines.

In my case the file ends with text (it ends with some more text). While moving the text block, which ends with a new line, to the end of the file, unintentionally attempting to move one line further makes the whole text selection disappear. Basically the entire text selection is replaced by a single empty line.

Step 1

create a file and add text to it:

text to move
some more text

Step 2

select the entire line + linebreak: text to move\n

Step 3

Tests

  1. move selection down 1x - lines are swapped
  2. move selection down 2x - lines are swapped then selection is replaced with empty line
  3. move selection down 3x - lines are swapped, selection replaced with empty line then entire file replaced by empty line

Results (with line numbering)

1    some more text
2    text to move
1    some more text
2
1
0 Likes

#4

This will be fixed in the next release, thanks for the detailed bug report.

1 Like