aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_functions.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-04 19:35:31 +0800
committerGitHub <noreply@github.com>2023-02-04 19:35:31 +0800
commit90333b24c3582cb017d823583d4896c8bbb8edb8 (patch)
tree5ef8c616359c5300fe4242d9fe5c1bf226bf7a20 /src/nvim/testdir/test_functions.vim
parent964ae205a583807127eda75d9876fb6dfda6065c (diff)
downloadrneovim-90333b24c3582cb017d823583d4896c8bbb8edb8.tar.gz
rneovim-90333b24c3582cb017d823583d4896c8bbb8edb8.tar.bz2
rneovim-90333b24c3582cb017d823583d4896c8bbb8edb8.zip
vim-patch:9.0.1277: cursor may move with autocmd in Visual mode (#22116)
Problem: Cursor may move with autocmd in Visual mode. Solution: Restore "VIsual_active" before calling check_cursor(). (closes vim/vim#11939) https://github.com/vim/vim/commit/49f0524fb575bb1cf4881e472afab7d37c579440
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r--src/nvim/testdir/test_functions.vim11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index 500c30c76b..4ed1187a19 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -1511,7 +1511,7 @@ endfunc
func Test_setbufvar_options()
" This tests that aucmd_prepbuf() and aucmd_restbuf() properly restore the
- " window layout.
+ " window layout and cursor position.
call assert_equal(1, winnr('$'))
split dummy_preview
resize 2
@@ -1525,11 +1525,20 @@ func Test_setbufvar_options()
execute 'belowright vertical split #' . dummy_buf
call assert_equal(wh, winheight(0))
let dum1_id = win_getid()
+ call setline(1, 'foo')
+ normal! V$
+ call assert_equal(4, col('.'))
+ call setbufvar('dummy_preview', '&buftype', 'nofile')
+ call assert_equal(4, col('.'))
wincmd h
let wh = winheight(0)
+ call setline(1, 'foo')
+ normal! V$
+ call assert_equal(4, col('.'))
let dummy_buf = bufnr('dummy_buf2', v:true)
eval 'nofile'->setbufvar(dummy_buf, '&buftype')
+ call assert_equal(4, col('.'))
execute 'belowright vertical split #' . dummy_buf
call assert_equal(wh, winheight(0))