summaryrefslogtreecommitdiffstats
path: root/src/autocmd.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/autocmd.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/autocmd.c')
-rw-r--r--src/autocmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/autocmd.c b/src/autocmd.c
index 8a7e6072a9..9632c74d49 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -2258,7 +2258,7 @@ apply_autocmds_group(
saveRedobuff(&save_redo);
did_save_redobuff = TRUE;
}
- did_filetype = keep_filetype;
+ curbuf->b_did_filetype = curbuf->b_keep_filetype;
}
/*
@@ -2270,7 +2270,7 @@ apply_autocmds_group(
// Remember that FileType was triggered. Used for did_filetype().
if (event == EVENT_FILETYPE)
- did_filetype = TRUE;
+ curbuf->b_did_filetype = TRUE;
tail = gettail(fname);
@@ -2379,7 +2379,7 @@ apply_autocmds_group(
restore_search_patterns();
if (did_save_redobuff)
restoreRedobuff(&save_redo);
- did_filetype = FALSE;
+ curbuf->b_did_filetype = FALSE;
while (au_pending_free_buf != NULL)
{
buf_T *b = au_pending_free_buf->b_next;
@@ -2421,7 +2421,7 @@ BYPASS_AU:
aubuflocal_remove(buf);
if (retval == OK && event == EVENT_FILETYPE)
- au_did_filetype = TRUE;
+ curbuf->b_au_did_filetype = TRUE;
return retval;
}