mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 19:06:31 +00:00
vim-patch:8.0.1765: CTRL-G j in Insert mode is incorrect when 'virtualedit' set (#8757)
Problem: CTRL-G j in Insert mode is incorrect when 'virtualedit' is set.
Solution: Take coladd into account. (Christian Brabandt, closes vim/vim#2743)
db0eedec16
This commit is contained in:

committed by
Justin M. Keyes

parent
48c0e916a1
commit
765711e272
@@ -1344,7 +1344,11 @@ colnr_T getvcol_nolist(pos_T *posp)
|
|||||||
colnr_T vcol;
|
colnr_T vcol;
|
||||||
|
|
||||||
curwin->w_p_list = false;
|
curwin->w_p_list = false;
|
||||||
getvcol(curwin, posp, NULL, &vcol, NULL);
|
if (posp->coladd) {
|
||||||
|
getvvcol(curwin, posp, NULL, &vcol, NULL);
|
||||||
|
} else {
|
||||||
|
getvcol(curwin, posp, NULL, &vcol, NULL);
|
||||||
|
}
|
||||||
curwin->w_p_list = list_save;
|
curwin->w_p_list = list_save;
|
||||||
return vcol;
|
return vcol;
|
||||||
}
|
}
|
||||||
|
@@ -38,6 +38,24 @@ func Test_paste_end_of_line()
|
|||||||
exe "normal! 2G$lllA\<C-O>:normal! \"agP\r"
|
exe "normal! 2G$lllA\<C-O>:normal! \"agP\r"
|
||||||
call assert_equal('123456', getline(2))
|
call assert_equal('123456', getline(2))
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
set virtualedit=
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_edit_CTRL_G()
|
||||||
|
new
|
||||||
|
set virtualedit=insert
|
||||||
|
call setline(1, ['123', '1', '12'])
|
||||||
|
exe "normal! ggA\<c-g>jx\<c-g>jx"
|
||||||
|
call assert_equal(['123', '1 x', '12 x'], getline(1,'$'))
|
||||||
|
|
||||||
|
set virtualedit=all
|
||||||
|
%d_
|
||||||
|
call setline(1, ['1', '12'])
|
||||||
|
exe "normal! ggllix\<c-g>jx"
|
||||||
|
call assert_equal(['1 x', '12x'], getline(1,'$'))
|
||||||
|
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
set virtualedit=
|
set virtualedit=
|
||||||
endfunc
|
endfunc
|
||||||
|
Reference in New Issue
Block a user