patch 8.2.2581: Vim9: sourcing Vim9 script triggers a redraw
Problem: Vim9: sourcing Vim9 script triggers a redraw.
Solution: Do not let setting/restoring 'cpoptions' cause a redraw.
(closes #7920)
diff --git a/src/optionstr.c b/src/optionstr.c
index a1cbe26..521242d 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -2461,11 +2461,14 @@
&& (get_option_flags(opt_idx) & (P_CURSWANT | P_RALL)) != 0)
curwin->w_set_curswant = TRUE;
+ if ((opt_flags & OPT_NO_REDRAW) == 0)
+ {
#ifdef FEAT_GUI
- // check redraw when it's not a GUI option or the GUI is active.
- if (!redraw_gui_only || gui.in_use)
+ // check redraw when it's not a GUI option or the GUI is active.
+ if (!redraw_gui_only || gui.in_use)
#endif
- check_redraw(get_option_flags(opt_idx));
+ check_redraw(get_option_flags(opt_idx));
+ }
#if defined(FEAT_VTP) && defined(FEAT_TERMGUICOLORS)
if (did_swaptcap)