vim-patch:8.0.0677: setting 'filetype' may switch buffers

Problem:    Setting 'filetype' internally may cause the current buffer and
            window to change unexpectedly.
Solution:   Set curbuf_lock. (closes vim/vim#1734)
1814183b86
This commit is contained in:
Jan Edmund Lazo
2018-06-25 19:32:35 -04:00
parent da6874a7b2
commit bfe029a11d
4 changed files with 25 additions and 2 deletions

View File

@@ -4906,7 +4906,9 @@ void fix_help_buffer(void)
// Set filetype to "help".
if (STRCMP(curbuf->b_p_ft, "help") != 0) {
curbuf_lock++;
set_option_value("ft", 0L, "help", OPT_LOCAL);
curbuf_lock--;
}
if (!syntax_present(curwin)) {