aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-16 11:03:12 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-16 11:08:00 -0400
commitbe552c8340615a4c9e670bc77df5e6016214d4f4 (patch)
tree6b146ef4f9ea2f7e651abcc9336f850f6c88a032 /src/nvim/ex_docmd.c
parent6531b175addc33c710b6e4e3501077e1d7213a8c (diff)
downloadrneovim-be552c8340615a4c9e670bc77df5e6016214d4f4.tar.gz
rneovim-be552c8340615a4c9e670bc77df5e6016214d4f4.tar.bz2
rneovim-be552c8340615a4c9e670bc77df5e6016214d4f4.zip
vim-patch:8.0.1231: expanding file name drops dash
Problem: Expanding file name drops dash. (stucki) Solution: Use the right position. (Christian Brabandt, closes vim/vim#2184) https://github.com/vim/vim/commit/c312b8b87a589ed8452dbf0f555f05ff86d04692
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index df9f5774bc..5e5b6c382d 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -8521,9 +8521,13 @@ eval_vars (
if (*s == '<') /* "#<99" uses v:oldfiles */
++s;
i = getdigits_int(&s);
+ if (s == src + 2 && src[1] == '-') {
+ // just a minus sign, don't skip over it
+ s--;
+ }
*usedlen = (size_t)(s - src); /* length of what we expand */
- if (src[1] == '<') {
+ if (src[1] == '<' && i != 0) {
if (*usedlen < 2) {
/* Should we give an error message for #<text? */
*usedlen = 1;
@@ -8536,6 +8540,9 @@ eval_vars (
return NULL;
}
} else {
+ if (i == 0 && src[1] == '<' && *usedlen > 1) {
+ *usedlen = 1;
+ }
buf = buflist_findnr(i);
if (buf == NULL) {
*errormsg = (char_u *)_(