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)
177ab9e026
This commit is contained in:
Jan Edmund Lazo 2019-07-20 08:12:56 -04:00 committed by Justin M. Keyes
parent 643ba06d4d
commit 7935f6ce35
2 changed files with 21 additions and 1 deletions

View File

@ -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}}
},
{

View File

@ -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