aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-01 06:12:11 +0800
committerGitHub <noreply@github.com>2024-04-01 06:12:11 +0800
commitb08667d4f00e434eac9874e4005ab8e1fd9d3e95 (patch)
treebf4b40e983294fbf96bdd6b9699cdb6526dd0fe6 /src/nvim/buffer_defs.h
parente005b8d2eb0d5967d46cae604e3fac0ccae37555 (diff)
downloadrneovim-b08667d4f00e434eac9874e4005ab8e1fd9d3e95.tar.gz
rneovim-b08667d4f00e434eac9874e4005ab8e1fd9d3e95.tar.bz2
rneovim-b08667d4f00e434eac9874e4005ab8e1fd9d3e95.zip
vim-patch:9.1.0231: Filetype may be undetected when SwapExists sets ft in other buf (#28136)
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: vim/vim#14344 https://github.com/vim/vim/commit/5bf6c2117fcef85fcf046c098dd3eb72a0147859
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 7f7300706c..083508fe86 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -461,6 +461,19 @@ struct file_buffer {
bool b_marks_read; // Have we read ShaDa marks yet?
+ bool b_modified_was_set; ///< did ":set modified"
+ bool b_did_filetype; ///< FileType event found
+ bool b_keep_filetype; ///< value for did_filetype when starting
+ ///< to execute autocommands
+
+ /// Set by the apply_autocmds_group function if the given event is equal to
+ /// EVENT_FILETYPE. Used by the readfile function in order to determine if
+ /// EVENT_BUFREADPOST triggered the EVENT_FILETYPE.
+ ///
+ /// Relying on this value requires one to reset it prior calling
+ /// apply_autocmds_group().
+ bool b_au_did_filetype;
+
// The following only used in undo.c.
u_header_T *b_u_oldhead; // pointer to oldest header
u_header_T *b_u_newhead; // pointer to newest header; may not be valid