diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2018-11-11 13:13:14 -0500 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2018-11-11 19:13:14 +0100 |
| commit | 9f3fb66111d3a7923106df60837f3150b3cf55b9 (patch) | |
| tree | e6d8ae4fc4e7b56ded377f61efacb5a378f9d4a0 /src/nvim/testdir | |
| parent | c936ae0f3688d1cf159506d2d9ba3f9be41298a2 (diff) | |
| download | rneovim-9f3fb66111d3a7923106df60837f3150b3cf55b9.tar.gz rneovim-9f3fb66111d3a7923106df60837f3150b3cf55b9.tar.bz2 rneovim-9f3fb66111d3a7923106df60837f3150b3cf55b9.zip | |
vim-patch:8.1.0516: :move command sets 'modified' #9224
Problem: :move command marks buffer modified when nothing changed.
Solution: Do not set 'modified'. Add a test. (Jason Franklin)
https://github.com/vim/vim/commit/ddd1f9183bed00d096f29c503721ac559174a29f
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_alot.vim | 1 | ||||
| -rw-r--r-- | src/nvim/testdir/test_move.vim | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 36dcdc3386..0602ff6a45 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -28,6 +28,7 @@ source test_lambda.vim source test_mapping.vim source test_menu.vim source test_messages.vim +source test_move.vim source test_partial.vim source test_popup.vim source test_put.vim diff --git a/src/nvim/testdir/test_move.vim b/src/nvim/testdir/test_move.vim new file mode 100644 index 0000000000..d774c93dbd --- /dev/null +++ b/src/nvim/testdir/test_move.vim @@ -0,0 +1,40 @@ +" Test the ":move" command. + +func Test_move() + enew! + call append(0, ['line 1', 'line 2', 'line 3']) + g /^$/ delete _ + set nomodified + + move . + call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3)) + call assert_false(&modified) + + 1,2move 0 + call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3)) + call assert_false(&modified) + + 1,3move 3 + call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3)) + call assert_false(&modified) + + 1move 2 + call assert_equal(['line 2', 'line 1', 'line 3'], getline(1, 3)) + call assert_true(&modified) + set nomodified + + 3move 0 + call assert_equal(['line 3', 'line 2', 'line 1'], getline(1, 3)) + call assert_true(&modified) + set nomodified + + 2,3move 0 + call assert_equal(['line 2', 'line 1', 'line 3'], getline(1, 3)) + call assert_true(&modified) + set nomodified + + call assert_fails('1,2move 1', 'E134') + call assert_fails('2,3move 2', 'E134') + + %bwipeout! +endfunc |