aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-12-11 20:46:13 -0500
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-12-12 19:15:05 -0500
commit4157f4c72db7eab71b9670d517a8cbd3ed8909ba (patch)
treefc0f9c00213a2b4e67bbde4af5d8d807e928d823 /src/nvim/ex_docmd.c
parent0930435fc30d1e7e6be05ed1cd1d072e3616b6f4 (diff)
downloadrneovim-4157f4c72db7eab71b9670d517a8cbd3ed8909ba.tar.gz
rneovim-4157f4c72db7eab71b9670d517a8cbd3ed8909ba.tar.bz2
rneovim-4157f4c72db7eab71b9670d517a8cbd3ed8909ba.zip
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 <afile> on CmdlineEnter and related events in vim-patch:8.0.1748. Port the hack by not treating "/" as a path for <afile> on these events.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c5
1 files changed, 4 insertions, 1 deletions
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, <afile> 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 <afile> is not used.
result = (char_u *)FullName_save((char *)autocmd_fname, false);