diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-04-01 06:12:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-01 06:12:11 +0800 |
commit | b08667d4f00e434eac9874e4005ab8e1fd9d3e95 (patch) | |
tree | bf4b40e983294fbf96bdd6b9699cdb6526dd0fe6 /src/nvim/buffer_defs.h | |
parent | e005b8d2eb0d5967d46cae604e3fac0ccae37555 (diff) | |
download | rneovim-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.h | 13 |
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 |