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)
c312b8b87a
This commit is contained in:
Jan Edmund Lazo
2018-08-16 11:03:12 -04:00
parent 6531b175ad
commit be552c8340
2 changed files with 29 additions and 1 deletions

View File

@@ -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 *)_(