Don't include the bottom line of selection if blank
This commit is contained in:
@@ -42,3 +42,18 @@ def test_sort_selection_does_not_include_eof(run, unsorted):
|
||||
h.await_cursor_position(x=0, y=1)
|
||||
h.press('^S')
|
||||
assert unsorted.read() == 'a\nb\nc\nd\n'
|
||||
|
||||
|
||||
def test_sort_does_not_include_blank_line_after(run, tmpdir):
|
||||
f = tmpdir.join('f')
|
||||
f.write('b\na\n\nd\nc\n')
|
||||
|
||||
with run(str(f)) as h, and_exit(h):
|
||||
h.press('S-Down')
|
||||
h.press('S-Down')
|
||||
trigger_command_mode(h)
|
||||
h.press_and_enter(':sort')
|
||||
h.await_text('sorted!')
|
||||
h.await_cursor_position(x=0, y=1)
|
||||
h.press('^S')
|
||||
assert f.read() == 'a\nb\n\nd\nc\n'
|
||||
|
||||
Reference in New Issue
Block a user