Re: [vim/vim] `expand()` and `expandcmd()` behave differently on `%:~` (Issue #20793)
h_east (Vim Github Repository) <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/issues/20793/[email protected]> |
h-east left a comment (vim/vim#20793) @EdwinChan One practical note now that this is closed: `%:~:s?\~?/app?` already does what you want, in `'makeprg'` and in a `:!` command as well, without hardcoding `$HOME`. That follows from the two steps. The whole modifier chain is consumed in step 1, since `eval_vars()` passes `:~:s?..?..?` to `modify_fname()`. Once your `:s` has removed the `~`, step 2 finds neither a `~` nor a `$` in the result and leaves it alone. This is also why `%:p` and `%:h` look unaffected: they take the very same path, they just never produce a `~` for step 2 to act on. -- Reply to this email directly or view it on GitHub: https://github.com/vim/vim/issues/20793#issuecomment-5079743328 You are receiving this because you are subscribed to this thread. Message ID: <vim/vim/issues/20793/[email protected]> -- -- 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/vim/vim/issues/20793/5079743328%40github.com.