mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:9.1.0183: Wrong display or screenpos() result when toggling diff mode (#27882)
Problem: Wrong display or screenpos() result when toggling diff mode.
Solution: Reset w_skipcol when disabling 'wrap'. Reset w_leftcol when
enabling 'wrap' (zeertzjq).
fixes: vim/vim#14210
closes: vim/vim#14211
9e7f1fc2f1
This commit is contained in:
@@ -1429,6 +1429,7 @@ void diff_win_options(win_T *wp, bool addbuf)
|
||||
wp->w_p_wrap_save = wp->w_p_wrap;
|
||||
}
|
||||
wp->w_p_wrap = false;
|
||||
wp->w_skipcol = 0;
|
||||
}
|
||||
|
||||
if (!wp->w_p_diff) {
|
||||
@@ -1497,8 +1498,9 @@ void ex_diffoff(exarg_T *eap)
|
||||
wp->w_p_crb = wp->w_p_crb_save;
|
||||
}
|
||||
if (!(diff_flags & DIFF_FOLLOWWRAP)) {
|
||||
if (!wp->w_p_wrap) {
|
||||
wp->w_p_wrap = wp->w_p_wrap_save;
|
||||
if (!wp->w_p_wrap && wp->w_p_wrap_save) {
|
||||
wp->w_p_wrap = true;
|
||||
wp->w_leftcol = 0;
|
||||
}
|
||||
}
|
||||
free_string_option(wp->w_p_fdm);
|
||||
|
Reference in New Issue
Block a user