1
0
forked from aniani/vim

patch 8.0.0405: v:progpath may become invalid after :cd

Problem:    v:progpath may become invalid after ":cd".
Solution:   Turn v:progpath into a full path if needed.
This commit is contained in:
Bram Moolenaar
2017-03-04 14:37:18 +01:00
parent 391b1dd040
commit 08cab96087
4 changed files with 50 additions and 4 deletions

View File

@@ -1789,8 +1789,11 @@ v:progpath Contains the command with which Vim was invoked, including the
|--remote-expr|.
To get the full path use: >
echo exepath(v:progpath)
< NOTE: This does not work when the command is a relative path
and the current directory has changed.
< If the path is relative it will be expanded to the full path,
so that it still works after `:cd`. Thus starting "./vim"
results in "/home/user/path/to/vim/src/vim".
On MS-Windows the executable may be called "vim.exe", but the
".exe" is not added to v:progpath.
Read-only.
*v:register* *register-variable*