vim-patch:8.1.0998: getcurpos() unexpectedly changes "curswant"

Problem:    getcurpos() unexpectedly changes "curswant".
Solution:   Save and restore "curswant". (closes vim/vim#4069)
19a66858a5
This commit is contained in:
Jan Edmund Lazo
2019-03-07 22:11:26 -05:00
parent 5f84b1dc41
commit 72e304c349
2 changed files with 24 additions and 4 deletions

View File

@@ -1,8 +1,4 @@
" Tests for various Visual mode.
if !has('visual')
finish
endif
func Test_block_shift_multibyte()
" Uses double-wide character.
@@ -318,3 +314,14 @@ func Test_Visual_sentence_textobject()
bwipe!
endfunc
func Test_curswant_not_changed()
new
call setline(1, ['one', 'two'])
au InsertLeave * call getcurpos()
call feedkeys("gg0\<C-V>jI123 \<Esc>j", 'xt')
call assert_equal([0, 2, 1, 0, 1], getcurpos())
bwipe!
au! InsertLeave
endfunc