aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/ex_cmds.lua2
-rw-r--r--src/nvim/option.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua
index c87e3d4c66..31776a70e7 100644
--- a/src/nvim/ex_cmds.lua
+++ b/src/nvim/ex_cmds.lua
@@ -3076,7 +3076,7 @@ return {
},
{
command='wincmd',
- flags=bit.bor(NEEDARG, WORD1, RANGE, NOTADR),
+ flags=bit.bor(NEEDARG, WORD1, RANGE, NOTADR, CMDWIN),
addr_type=ADDR_WINDOWS,
func='ex_wincmd',
},
diff --git a/src/nvim/option.c b/src/nvim/option.c
index ed845df416..50c172b580 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -3243,6 +3243,10 @@ did_set_string_option (
did_filetype = true;
apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft,
curbuf->b_fname, true, curbuf);
+ // Just in case the old "curbuf" is now invalid
+ if (varp != &(curbuf->b_p_ft)) {
+ varp = NULL;
+ }
}
}
if (varp == &(curwin->w_s->b_p_spl)) {