summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-31 18:41:27 +0200
committerChristian Brabandt <cb@256bit.org>2024-03-31 18:41:27 +0200
commit5bf6c2117fcef85fcf046c098dd3eb72a0147859 (patch)
tree32804af25b55ac2859188f9bc0771a38d078862c /src/ex_docmd.c
parent86032702932995db74fed265ba99ae0c823cb75d (diff)
patch 9.1.0231: Filetype may be undetected when SwapExists sets ft in other bufv9.1.0231
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>
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 981d270dc7..cc42e52a5a 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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