Mercurial > vim
comparison src/testdir/test_move.vim @ 15010:e3910b9827d0 v8.1.0516
patch 8.1.0516: :move command marks buffer modified when nothing changed
commit https://github.com/vim/vim/commit/ddd1f9183bed00d096f29c503721ac559174a29f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 10 19:19:36 2018 +0100
patch 8.1.0516: :move command marks buffer modified when nothing changed
Problem: :move command marks buffer modified when nothing changed.
Solution: Do not set 'modified'. Add a test. (Jason Franklin)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 10 Nov 2018 19:30:05 +0100 |
parents | |
children | b8fd7364befd |
comparison
equal
deleted
inserted
replaced
15009:29667f9e57b5 | 15010:e3910b9827d0 |
---|---|
1 " Test the ":move" command. | |
2 | |
3 func Test_move() | |
4 enew! | |
5 call append(0, ['line 1', 'line 2', 'line 3']) | |
6 g /^$/ delete _ | |
7 set nomodified | |
8 | |
9 move . | |
10 call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3)) | |
11 call assert_false(&modified) | |
12 | |
13 1,2move 0 | |
14 call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3)) | |
15 call assert_false(&modified) | |
16 | |
17 1,3move 3 | |
18 call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3)) | |
19 call assert_false(&modified) | |
20 | |
21 1move 2 | |
22 call assert_equal(['line 2', 'line 1', 'line 3'], getline(1, 3)) | |
23 call assert_true(&modified) | |
24 set nomodified | |
25 | |
26 3move 0 | |
27 call assert_equal(['line 3', 'line 2', 'line 1'], getline(1, 3)) | |
28 call assert_true(&modified) | |
29 set nomodified | |
30 | |
31 2,3move 0 | |
32 call assert_equal(['line 2', 'line 1', 'line 3'], getline(1, 3)) | |
33 call assert_true(&modified) | |
34 set nomodified | |
35 | |
36 call assert_fails('1,2move 1', 'E134') | |
37 call assert_fails('2,3move 2', 'E134') | |
38 | |
39 %bwipeout! | |
40 endfunc |