From 4157f4c72db7eab71b9670d517a8cbd3ed8909ba Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 11 Dec 2018 20:46:13 -0500 Subject: ex_docmd: '/' is not a path for Cmdline* events Code from https://github.com/neovim/neovim/pull/9348#issuecomment-446416118 autocmd_fname_full was removed in https://github.com/neovim/neovim/commit/82cd0be2eaf71c0476e15c66ba3e83c76896d407 but Vim uses this hack for on CmdlineEnter and related events in vim-patch:8.0.1748. Port the hack by not treating "/" as a path for on these events. --- src/nvim/ex_docmd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 6361267d9b..4ef332186e 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -8654,7 +8654,10 @@ eval_vars ( break; case SPEC_AFILE: // file name for autocommand - if (autocmd_fname != NULL && !path_is_absolute(autocmd_fname)) { + if (autocmd_fname != NULL + && !path_is_absolute(autocmd_fname) + // For CmdlineEnter and related events, is not a path! #9348 + && !strequal("/", (char *)autocmd_fname)) { // Still need to turn the fname into a full path. It was // postponed to avoid a delay when is not used. result = (char_u *)FullName_save((char *)autocmd_fname, false); -- cgit