Mercurial > vim
changeset 5780:d2286df8719d v7.4.234
updated for version 7.4.234
Problem: Can't get the command that was used to start Vim.
Solution: Add v:progpath. (Viktor Kojouharov)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 01 Apr 2014 19:55:49 +0200 |
parents | efce50628d78 |
children | eabbe5a74948 |
files | runtime/doc/eval.txt src/eval.c src/main.c src/version.c src/vim.h |
diffstat | 5 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1558,6 +1558,12 @@ v:progname Contains the name (with path |evim| etc., or any other name you might symlink to Vim. Read-only. + *v:progpath* *progpath-variable* +v:progpath Contains the command with which Vim was invoked, including the + path. Useful if you want to message a Vim server using a + |--remote-expr|. + Read-only. + *v:register* *register-variable* v:register The name of the register in effect for the current normal mode command (regardless of whether that command actually used a
--- a/src/eval.c +++ b/src/eval.c @@ -361,6 +361,7 @@ static struct vimvar {VV_NAME("hlsearch", VAR_NUMBER), 0}, {VV_NAME("oldfiles", VAR_LIST), 0}, {VV_NAME("windowid", VAR_NUMBER), VV_RO}, + {VV_NAME("progpath", VAR_STRING), VV_RO}, }; /* shorthand */
--- a/src/main.c +++ b/src/main.c @@ -1602,6 +1602,7 @@ parse_command_name(parmp) #ifdef FEAT_EVAL set_vim_var_string(VV_PROGNAME, initstr, -1); + set_vim_var_string(VV_PROGPATH, (char_u *)parmp->argv[0], -1); #endif if (TOLOWER_ASC(initstr[0]) == 'r')