comparison src/testdir/test_visual.vim @ 15985:e91750e8adb5 v8.1.0998

patch 8.1.0998: getcurpos() unexpectedly changes "curswant" commit https://github.com/vim/vim/commit/19a66858a5e3fedadc371321834507c34e2dfb18 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 7 11:25:32 2019 +0100 patch 8.1.0998: getcurpos() unexpectedly changes "curswant" Problem: getcurpos() unexpectedly changes "curswant". Solution: Save and restore "curswant". (closes https://github.com/vim/vim/issues/4069)
author Bram Moolenaar <Bram@vim.org>
date Thu, 07 Mar 2019 11:30:15 +0100
parents 2dcaa860e3fc
children aebcd20a8a3f
comparison
equal deleted inserted replaced
15984:9a4cfad3713a 15985:e91750e8adb5
1 " Tests for various Visual mode. 1 " Tests for various Visual mode.
2 if !has('visual')
3 finish
4 endif
5
6 2
7 func Test_block_shift_multibyte() 3 func Test_block_shift_multibyte()
8 " Uses double-wide character. 4 " Uses double-wide character.
9 split 5 split
10 call setline(1, ['xヹxxx', 'ヹxxx']) 6 call setline(1, ['xヹxxx', 'ヹxxx'])
395 norm! gvipy 391 norm! gvipy
396 call assert_equal("First line.\n\nSecond line.\nThird line.\nFourth line.\n", @") 392 call assert_equal("First line.\n\nSecond line.\nThird line.\nFourth line.\n", @")
397 393
398 bwipe! 394 bwipe!
399 endfunc 395 endfunc
396
397 func Test_curswant_not_changed()
398 new
399 call setline(1, ['one', 'two'])
400 au InsertLeave * call getcurpos()
401 call feedkeys("gg0\<C-V>jI123 \<Esc>j", 'xt')
402 call assert_equal([0, 2, 1, 0, 1], getcurpos())
403
404 bwipe!
405 au! InsertLeave
406 endfunc