diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-18 17:20:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 17:20:49 +0800 |
commit | eb8a3e0575d36ebfee1e401db0a064763cf684cd (patch) | |
tree | 81fa6b919f050563a33e592eea40de0223f3e994 /src/nvim/option.c | |
parent | b12d193b4a68242fb0c7e4f924c8abce3488e1c8 (diff) | |
download | rneovim-eb8a3e0575d36ebfee1e401db0a064763cf684cd.tar.gz rneovim-eb8a3e0575d36ebfee1e401db0a064763cf684cd.tar.bz2 rneovim-eb8a3e0575d36ebfee1e401db0a064763cf684cd.zip |
vim-patch:9.1.0114: Setting some options may change curswant (#27514)
Problem: Setting some options changes curswant unnecessarily.
Solution: Add a P_HLONLY flag that prevents changing curswant.
(zeertzjq)
closes: vim/vim#14044
https://github.com/vim/vim/commit/fcaed6a70faf73bff3e5405ada556d726024f866
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 42ccc1fbd4..0ac65ed95d 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3029,14 +3029,15 @@ void check_redraw_for(buf_T *buf, win_T *win, uint32_t flags) } if ((flags & P_RBUF) || (flags & P_RWIN) || all) { - changed_window_setting_win(win); + if (flags & P_HLONLY) { + redraw_later(win, UPD_NOT_VALID); + } else { + changed_window_setting_win(win); + } } if (flags & P_RBUF) { redraw_buf_later(buf, UPD_NOT_VALID); } - if (flags & P_RWINONLY) { - redraw_later(win, UPD_NOT_VALID); - } if (all) { redraw_all_later(UPD_NOT_VALID); } @@ -3554,7 +3555,7 @@ static const char *did_set_option(OptIndex opt_idx, void *varp, OptVal old_value do_spelllang_source(curwin); } - // In case 'columns' or 'ls' changed. + // In case 'ruler' or 'showcmd' or 'columns' or 'ls' changed. comp_col(); if (varp == &p_mouse) { @@ -3568,7 +3569,8 @@ static const char *did_set_option(OptIndex opt_idx, void *varp, OptVal old_value set_winbar(true); } - if (curwin->w_curswant != MAXCOL && (opt->flags & (P_CURSWANT | P_RALL)) != 0) { + if (curwin->w_curswant != MAXCOL + && (opt->flags & (P_CURSWANT | P_RALL)) != 0 && (opt->flags & P_HLONLY) == 0) { curwin->w_set_curswant = true; } |