diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-07-20 08:12:56 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-07-20 14:12:56 +0200 |
commit | 7935f6ce35fd65225b2bd6921078ef1036b19ae5 (patch) | |
tree | 5ddfb324d54739b56fc33d7cc6bb77c14772337d | |
parent | 643ba06d4d4373d2d3f8936f71f777f627fad5f6 (diff) | |
download | rneovim-7935f6ce35fd65225b2bd6921078ef1036b19ae5.tar.gz rneovim-7935f6ce35fd65225b2bd6921078ef1036b19ae5.tar.bz2 rneovim-7935f6ce35fd65225b2bd6921078ef1036b19ae5.zip |
vim-patch:8.1.0754: preferred column when setting 'cursorcolumn' #10549
Problem: Preferred column is lost when setting 'cursorcolumn'.
Solution: Change option flag to P_RWINONLY. (Takayuki Kurosawa,
closes vim/vim#3806)
https://github.com/vim/vim/commit/177ab9e0262b1b3a6120bea655864ead487210e5
-rw-r--r-- | src/nvim/options.lua | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_cursor_func.vim | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/nvim/options.lua b/src/nvim/options.lua index ceff120e4f..3280c92b2d 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -543,7 +543,7 @@ return { full_name='cursorcolumn', abbreviation='cuc', type='bool', scope={'window'}, vi_def=true, - redraw={'current_window'}, + redraw={'current_window_only'}, defaults={if_true={vi=false}} }, { diff --git a/src/nvim/testdir/test_cursor_func.vim b/src/nvim/testdir/test_cursor_func.vim index e1b9651c84..6bc9535aaf 100644 --- a/src/nvim/testdir/test_cursor_func.vim +++ b/src/nvim/testdir/test_cursor_func.vim @@ -44,3 +44,23 @@ func Test_curswant_with_autocommand() quit! endfunc +" Tests for behavior of curswant with cursorcolumn/line +func Test_curswant_with_cursorcolumn() + new + call setline(1, ['01234567', '']) + exe "normal! ggf6j" + call assert_equal(6, winsaveview().curswant) + set cursorcolumn + call assert_equal(6, winsaveview().curswant) + quit! +endfunc + +func Test_curswant_with_cursorline() + new + call setline(1, ['01234567', '']) + exe "normal! ggf6j" + call assert_equal(6, winsaveview().curswant) + set cursorline + call assert_equal(6, winsaveview().curswant) + quit! +endfunc |