aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2018-10-11 02:27:37 -0400
committerJustin M. Keyes <justinkz@gmail.com>2018-10-11 08:27:37 +0200
commit2bf1aa5628674e4cda60ac9926bde57bc115e7b7 (patch)
treebf2521d91f0fcdb50a3eb361b0534453fa14fcd9 /src/nvim/fileio.c
parente17e21e4cfb4c9c402b26e49f36af6c2ca6239ec (diff)
downloadrneovim-2bf1aa5628674e4cda60ac9926bde57bc115e7b7.tar.gz
rneovim-2bf1aa5628674e4cda60ac9926bde57bc115e7b7.tar.bz2
rneovim-2bf1aa5628674e4cda60ac9926bde57bc115e7b7.zip
vim-patch:8.0.1777: cannot cleanup before loading another colorscheme (#9104)
Problem: Cannot cleanup before loading another colorscheme. Solution: Add the ColorSchemePre autocommand event. https://github.com/vim/vim/commit/60a68362aa73f4a6cb534688978f9dc2b16e60fe
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 3ab7710de5..a5ff13552b 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -6779,7 +6779,9 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
* invalid.
*/
if (fname_io == NULL) {
- if (event == EVENT_COLORSCHEME || event == EVENT_OPTIONSET) {
+ if (event == EVENT_COLORSCHEME
+ || event == EVENT_COLORSCHEMEPRE
+ || event == EVENT_OPTIONSET) {
autocmd_fname = NULL;
} else if (fname != NULL && !ends_excmd(*fname)) {
autocmd_fname = fname;
@@ -6830,6 +6832,7 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
sfname = vim_strsave(fname);
// Don't try expanding the following events.
if (event == EVENT_COLORSCHEME
+ || event == EVENT_COLORSCHEMEPRE
|| event == EVENT_DIRCHANGED
|| event == EVENT_FILETYPE
|| event == EVENT_FUNCUNDEFINED