mirror of
https://github.com/vim/vim.git
synced 2025-08-22 19:27:53 -04:00
patch 8.2.1658: expand('<stack>') has trailing ".."
Problem: Expand('<stack>') has trailing "..". Solution: Remove the "..". (closes #6927)
This commit is contained in:
parent
8b848cafb0
commit
a810db3f17
@ -144,7 +144,8 @@ estack_sfile(estack_arg_T which UNUSED)
|
|||||||
entry = ((estack_T *)exestack.ga_data) + idx;
|
entry = ((estack_T *)exestack.ga_data) + idx;
|
||||||
if (entry->es_name != NULL)
|
if (entry->es_name != NULL)
|
||||||
{
|
{
|
||||||
long lnum = 0;
|
long lnum = 0;
|
||||||
|
char *dots;
|
||||||
|
|
||||||
len = STRLEN(entry->es_name) + 15;
|
len = STRLEN(entry->es_name) + 15;
|
||||||
type_name = "";
|
type_name = "";
|
||||||
@ -165,16 +166,16 @@ estack_sfile(estack_arg_T which UNUSED)
|
|||||||
lnum = which == ESTACK_STACK ? SOURCING_LNUM : 0;
|
lnum = which == ESTACK_STACK ? SOURCING_LNUM : 0;
|
||||||
else
|
else
|
||||||
lnum = entry->es_lnum;
|
lnum = entry->es_lnum;
|
||||||
|
dots = idx == exestack.ga_len - 1 ? "" : "..";
|
||||||
if (lnum == 0)
|
if (lnum == 0)
|
||||||
// For the bottom entry of <sfile>: do not add the line number,
|
// For the bottom entry of <sfile>: do not add the line number,
|
||||||
// it is used in <slnum>. Also leave it out when the number is
|
// it is used in <slnum>. Also leave it out when the number is
|
||||||
// not set.
|
// not set.
|
||||||
vim_snprintf((char *)ga.ga_data + ga.ga_len, len, "%s%s%s",
|
vim_snprintf((char *)ga.ga_data + ga.ga_len, len, "%s%s%s",
|
||||||
type_name, entry->es_name,
|
type_name, entry->es_name, dots);
|
||||||
idx == exestack.ga_len - 1 ? "" : "..");
|
|
||||||
else
|
else
|
||||||
vim_snprintf((char *)ga.ga_data + ga.ga_len, len, "%s%s[%ld]..",
|
vim_snprintf((char *)ga.ga_data + ga.ga_len, len, "%s%s[%ld]%s",
|
||||||
type_name, entry->es_name, lnum);
|
type_name, entry->es_name, lnum, dots);
|
||||||
ga.ga_len += (int)STRLEN((char *)ga.ga_data + ga.ga_len);
|
ga.ga_len += (int)STRLEN((char *)ga.ga_data + ga.ga_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ func Test_expand_sfile_and_stack()
|
|||||||
END
|
END
|
||||||
call writefile(lines, 'Xstack')
|
call writefile(lines, 'Xstack')
|
||||||
source Xstack
|
source Xstack
|
||||||
call assert_match('\<Xstack\[2\]', g:stack_value)
|
call assert_match('\<Xstack\[2\]$', g:stack_value)
|
||||||
call delete('Xstack')
|
call delete('Xstack')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1658,
|
||||||
/**/
|
/**/
|
||||||
1657,
|
1657,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user