vim-patch:8.2.3280: 'virtualedit' local to buffer is not the best solution

Problem:    'virtualedit' local to buffer is not the best solution.
Solution:   Make it window-local. (Gary Johnson, closes vim/vim#8685)
51ad850f5f
This commit is contained in:
zeertzjq
2022-01-15 19:21:17 +08:00
parent d391940b9a
commit 87e54f123a
8 changed files with 54 additions and 36 deletions

View File

@@ -1215,14 +1215,14 @@ static void win_update(win_T *wp, Providers *providers)
*/
if (VIsual_mode == Ctrl_V) {
colnr_T fromc, toc;
unsigned int save_ve_flags = curbuf->b_ve_flags;
unsigned int save_ve_flags = curwin->w_ve_flags;
if (curwin->w_p_lbr) {
curbuf->b_ve_flags = VE_ALL;
curwin->w_ve_flags = VE_ALL;
}
getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc);
curbuf->b_ve_flags = save_ve_flags;
curwin->w_ve_flags = save_ve_flags;
toc++;
// Highlight to the end of the line, unless 'virtualedit' has
// "block".