updated for version 7.0218
diff --git a/src/option.c b/src/option.c
index 5c957e5..b14b4f9 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3774,9 +3774,11 @@
* does not need to be expanded with option_expand().
* "opt_flags":
* 0 for ":set"
- * OPT_GLOBAL for ":setglobal"
- * OPT_LOCAL for ":setlocal" and a modeline
+ * OPT_GLOBAL for ":setglobal"
+ * OPT_LOCAL for ":setlocal" and a modeline
* OPT_MODELINE for a modeline
+ * OPT_WINONLY to only set window-local options
+ * OPT_NOWIN to skip setting window-local options
*
* returns FAIL if an error is detected, OK otherwise
*/
@@ -3977,6 +3979,11 @@
&& (opt_idx < 0 || options[opt_idx].var != VAR_WIN))
goto skip;
+ /* Skip all options that are window-local (used for :vimgrep). */
+ if ((opt_flags & OPT_NOWIN) && opt_idx >= 0
+ && options[opt_idx].var == VAR_WIN)
+ goto skip;
+
/* Disallow changing some options from modelines */
if ((opt_flags & OPT_MODELINE) && (flags & P_SECURE))
{