mirror of
https://github.com/vim/vim.git
synced 2025-10-01 04:54:07 -04:00
patch 9.1.0231: Filetype may be undetected when SwapExists sets ft in other buf
Problem: Filetype may be undetected when a SwapExists autocommand sets filetype in another buffer. Solution: Make filetype detection state buffer-specific. Also fix a similar problem for 'modified' (zeertzjq). closes: #14344 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
8603270293
commit
5bf6c2117f
@@ -9898,7 +9898,7 @@ ex_filetype(exarg_T *eap)
|
||||
static void
|
||||
ex_setfiletype(exarg_T *eap)
|
||||
{
|
||||
if (did_filetype)
|
||||
if (curbuf->b_did_filetype)
|
||||
return;
|
||||
|
||||
char_u *arg = eap->arg;
|
||||
@@ -9907,7 +9907,7 @@ ex_setfiletype(exarg_T *eap)
|
||||
|
||||
set_option_value_give_err((char_u *)"filetype", 0L, arg, OPT_LOCAL);
|
||||
if (arg != eap->arg)
|
||||
did_filetype = FALSE;
|
||||
curbuf->b_did_filetype = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user