vim-patch:8.0.0704: problems with autocommands when opening help

Problem:    Problems with autocommands when opening help.
Solution:   Avoid using invalid "varp" value.  Allow using :wincmd if buffer
            is locked. (closes vim/vim#1806, closes vim/vim#1804)
163095f088
This commit is contained in:
Jan Edmund Lazo 2018-06-25 11:31:50 -04:00
parent 1cbc830189
commit b00211a551
2 changed files with 5 additions and 1 deletions

View File

@ -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',
},

View File

@ -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)) {