mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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 #1734)
This commit is contained in:
@@ -6835,7 +6835,11 @@ fix_help_buffer(void)
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Set filetype to "help" if still needed. */
|
||||
if (STRCMP(curbuf->b_p_ft, "help") != 0)
|
||||
{
|
||||
++curbuf_lock;
|
||||
set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL);
|
||||
--curbuf_lock;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
|
Reference in New Issue
Block a user