diff options
| author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-09-02 23:01:52 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-09-02 23:30:42 -0400 |
| commit | bd7371f4605032f015df9ab76ab5b25d61854932 (patch) | |
| tree | c940c7d08d95c581ffc959e563e3888d40ebab0e /src/nvim/testdir | |
| parent | 5c9cd009e161fac9d549533f966b930c51877f4f (diff) | |
| download | rneovim-bd7371f4605032f015df9ab76ab5b25d61854932.tar.gz rneovim-bd7371f4605032f015df9ab76ab5b25d61854932.tar.bz2 rneovim-bd7371f4605032f015df9ab76ab5b25d61854932.zip | |
vim-patch:8.1.0333: :mkview does not restore cursor properly after "$"
Problem: :mkview does not restore cursor properly after "$". (Dominique
Pelle)
Solution: Position the cursor with "normal! $".
https://github.com/vim/vim/commit/92c1b696413bf0e28f2fec22090d42e8a825eff2
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_mksession.vim | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index f7836ea4b9..b9012745c0 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -19,7 +19,8 @@ func Test_mksession() \ 'two tabs in one line', \ 'one ä multibyteCharacter', \ 'aä Ä two multiByte characters', - \ 'Aäöü three mulTibyte characters' + \ 'Aäöü three mulTibyte characters', + \ 'short line', \ ]) let tmpfile = 'Xtemp' exec 'w! ' . tmpfile @@ -41,6 +42,8 @@ func Test_mksession() norm! j16| split norm! j16| + split + norm! j$ wincmd l set nowrap @@ -63,7 +66,7 @@ func Test_mksession() split call wincol() mksession! Xtest_mks.out - let li = filter(readfile('Xtest_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"') + let li = filter(readfile('Xtest_mks.out'), 'v:val =~# "\\(^ *normal! [0$]\\|^ *exe ''normal!\\)"') let expected = [ \ 'normal! 016|', \ 'normal! 016|', @@ -73,6 +76,7 @@ func Test_mksession() \ 'normal! 016|', \ 'normal! 016|', \ 'normal! 016|', + \ 'normal! $', \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'", \ " normal! 016|", \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'", @@ -157,7 +161,7 @@ func Test_mkview_file() help :mkview set number norm! V}zf - let pos = getpos('.') + let pos = getcurpos() let linefoldclosed1 = foldclosed('.') mkview! Xview set nonumber @@ -169,7 +173,7 @@ func Test_mkview_file() source Xview call assert_equal(1, &number) call assert_match('\*:mkview\*$', getline('.')) - call assert_equal(pos, getpos('.')) + call assert_equal(pos, getcurpos()) call assert_equal(linefoldclosed1, foldclosed('.')) " Creating a view again with the same file name should fail (file @@ -192,7 +196,7 @@ func Test_mkview_loadview_with_viewdir() help :mkview set number norm! V}zf - let pos = getpos('.') + let pos = getcurpos() let linefoldclosed1 = foldclosed('.') mkview 1 set nonumber @@ -209,7 +213,7 @@ func Test_mkview_loadview_with_viewdir() \ glob('Xviewdir/*')) call assert_equal(1, &number) call assert_match('\*:mkview\*$', getline('.')) - call assert_equal(pos, getpos('.')) + call assert_equal(pos, getcurpos()) call assert_equal(linefoldclosed1, foldclosed('.')) call delete('Xviewdir', 'rf') |