Commit: runtime(doc): clarify expandcmd() and "~" behaviour
Christian Brabandt <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <[email protected]> |
runtime(doc): clarify expandcmd() and "~" behaviour Commit: https://github.com/vim/vim/commit/770eb7db17c44e41fc4eb1975d67f9ec022edb58 Author: Hirohito Higashi <[email protected]> Date: Sat Jul 25 16:40:40 2026 +0000 runtime(doc): clarify expandcmd() and "~" behaviour fixes: https://github.com/vim/vim/issues/20793 Signed-off-by: Hirohito Higashi <[email protected]> Signed-off-by: Christian Brabandt <[email protected]> diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index dc668c3a9..1f14e7528 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -3099,6 +3099,10 @@ expandcmd({string} [, {options}]) *expandcmd()* like with |expand()|, and environment variables, anywhere in {string}. "~user" and "~/path" are only expanded at the start. + The expansion is done in two steps: the special keywords are + evaluated first, then "~" and environment variables are + expanded in the result. Thus `expand('%:~')` keeps the "~", + while `expandcmd('%:~')` returns the full path. The following items are supported in the {options} Dict argument: -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1wnfUn-00DXWn-Ps%40256bit.org.