diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-21 06:57:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-21 06:57:13 +0800 |
commit | c6dcc6acd84adbaed8e6bcba0cb5e42bffdf1732 (patch) | |
tree | 87d2a92a9eac8deeccf1c896d4f20bca0b04f7d7 /src | |
parent | 61eca90f653f6788374c2c5c177d809e6bb5a40c (diff) | |
parent | 94f12e8a5947a31a3fca07c8df75ab62fef7b1a3 (diff) | |
download | rneovim-c6dcc6acd84adbaed8e6bcba0cb5e42bffdf1732.tar.gz rneovim-c6dcc6acd84adbaed8e6bcba0cb5e42bffdf1732.tar.bz2 rneovim-c6dcc6acd84adbaed8e6bcba0cb5e42bffdf1732.zip |
Merge pull request #18189 from zeertzjq/vim-8.2.4795
vim-patch:8.2.{4795,4796,4801}: 'cursorbind' scrolling depends on whether 'cursorline' is set
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/move.c | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_cursorline.vim | 36 |
2 files changed, 37 insertions, 3 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index c55a9a296b..ae908e893c 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -2279,9 +2279,7 @@ void do_check_cursorbind(void) int restart_edit_save = restart_edit; restart_edit = true; check_cursor(); - if (win_cursorline_standout(curwin) || curwin->w_p_cuc) { - validate_cursor(); - } + validate_cursor(); restart_edit = restart_edit_save; } // Correct cursor for multi-byte character. diff --git a/src/nvim/testdir/test_cursorline.vim b/src/nvim/testdir/test_cursorline.vim index 7e97df6027..e85e9304a3 100644 --- a/src/nvim/testdir/test_cursorline.vim +++ b/src/nvim/testdir/test_cursorline.vim @@ -314,5 +314,41 @@ func Test_cursorline_screenline_update() call delete('Xcul_screenline') endfunc +func Test_cursorline_cursorbind_horizontal_scroll() + CheckScreendump + + let lines =<< trim END + call setline(1, 'aa bb cc dd ee ff gg hh ii jj kk ll mm' .. + \ ' nn oo pp qq rr ss tt uu vv ww xx yy zz') + set nowrap + " The following makes the cursor apparent on the screen dump + set sidescroll=1 cursorcolumn + " add empty lines, required for cursorcolumn + call append(1, ['','','','']) + 20vsp + windo :set cursorbind + END + call writefile(lines, 'Xhor_scroll') + + let buf = RunVimInTerminal('-S Xhor_scroll', #{rows: 8}) + call term_sendkeys(buf, "20l") + call VerifyScreenDump(buf, 'Test_hor_scroll_1', {}) + call term_sendkeys(buf, "10l") + call VerifyScreenDump(buf, 'Test_hor_scroll_2', {}) + call term_sendkeys(buf, ":windo :set cursorline\<cr>") + call term_sendkeys(buf, "0") + call term_sendkeys(buf, "20l") + call VerifyScreenDump(buf, 'Test_hor_scroll_3', {}) + call term_sendkeys(buf, "10l") + call VerifyScreenDump(buf, 'Test_hor_scroll_4', {}) + call term_sendkeys(buf, ":windo :set nocursorline nocursorcolumn\<cr>") + call term_sendkeys(buf, "0") + call term_sendkeys(buf, "40l") + call VerifyScreenDump(buf, 'Test_hor_scroll_5', {}) + + call StopVimInTerminal(buf) + call delete('Xhor_scroll') +endfunc + " vim: shiftwidth=2 sts=2 expandtab |