mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.0030: "gF" does not work on output of "verbose command"
Problem: "gF" does not work on output of "verbose command". Solution: Recognize " line " and translations. (closes #5391)
This commit is contained in:
@@ -5462,7 +5462,6 @@ tv_get_number_chk(typval_T *varp, int *denote)
|
|||||||
break;
|
break;
|
||||||
case VAR_SPECIAL:
|
case VAR_SPECIAL:
|
||||||
return varp->vval.v_number == VVAL_TRUE ? 1 : 0;
|
return varp->vval.v_number == VVAL_TRUE ? 1 : 0;
|
||||||
break;
|
|
||||||
case VAR_JOB:
|
case VAR_JOB:
|
||||||
#ifdef FEAT_JOB_CHANNEL
|
#ifdef FEAT_JOB_CHANNEL
|
||||||
emsg(_("E910: Using a Job as a Number"));
|
emsg(_("E910: Using a Job as a Number"));
|
||||||
@@ -6147,7 +6146,7 @@ last_set_msg(sctx_T script_ctx)
|
|||||||
msg_puts((char *)p);
|
msg_puts((char *)p);
|
||||||
if (script_ctx.sc_lnum > 0)
|
if (script_ctx.sc_lnum > 0)
|
||||||
{
|
{
|
||||||
msg_puts(_(" line "));
|
msg_puts(_(line_msg));
|
||||||
msg_outnum((long)script_ctx.sc_lnum);
|
msg_outnum((long)script_ctx.sc_lnum);
|
||||||
}
|
}
|
||||||
verbose_leave();
|
verbose_leave();
|
||||||
|
@@ -2047,9 +2047,18 @@ file_name_in_line(
|
|||||||
if (file_lnum != NULL)
|
if (file_lnum != NULL)
|
||||||
{
|
{
|
||||||
char_u *p;
|
char_u *p;
|
||||||
|
char *line_english = " line ";
|
||||||
|
char *line_transl = _(line_msg);
|
||||||
|
|
||||||
// Get the number after the file name and a separator character
|
// Get the number after the file name and a separator character.
|
||||||
|
// Also accept " line 999" with and without the same translation as
|
||||||
|
// used in last_set_msg().
|
||||||
p = ptr + len;
|
p = ptr + len;
|
||||||
|
if (STRNCMP(p, line_english, STRLEN(line_english)) == 0)
|
||||||
|
p += STRLEN(line_english);
|
||||||
|
else if (STRNCMP(p, line_transl, STRLEN(line_transl)) == 0)
|
||||||
|
p += STRLEN(line_transl);
|
||||||
|
else
|
||||||
p = skipwhite(p);
|
p = skipwhite(p);
|
||||||
if (*p != NUL)
|
if (*p != NUL)
|
||||||
{
|
{
|
||||||
|
@@ -1660,6 +1660,8 @@ EXTERN short disallow_gui INIT(= FALSE);
|
|||||||
EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM"));
|
EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM"));
|
||||||
EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP"));
|
EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP"));
|
||||||
|
|
||||||
|
EXTERN char line_msg[] INIT(= N_(" line "));
|
||||||
|
|
||||||
#ifdef FEAT_CRYPT
|
#ifdef FEAT_CRYPT
|
||||||
EXTERN char need_key_msg[] INIT(= N_("Need encryption key for \"%s\""));
|
EXTERN char need_key_msg[] INIT(= N_("Need encryption key for \"%s\""));
|
||||||
#endif
|
#endif
|
||||||
|
@@ -58,6 +58,14 @@ func Test_gF()
|
|||||||
call assert_equal('Xfile', bufname('%'))
|
call assert_equal('Xfile', bufname('%'))
|
||||||
call assert_equal(3, getcurpos()[1])
|
call assert_equal(3, getcurpos()[1])
|
||||||
|
|
||||||
|
enew!
|
||||||
|
call setline(1, ['one', 'the Xfile line 2, and more', 'three'])
|
||||||
|
w! Xfile2
|
||||||
|
normal 2GfX
|
||||||
|
normal gF
|
||||||
|
call assert_equal('Xfile', bufname('%'))
|
||||||
|
call assert_equal(2, getcurpos()[1])
|
||||||
|
|
||||||
set isfname&
|
set isfname&
|
||||||
call delete('Xfile')
|
call delete('Xfile')
|
||||||
call delete('Xfile2')
|
call delete('Xfile2')
|
||||||
|
@@ -742,6 +742,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 */
|
||||||
|
/**/
|
||||||
|
30,
|
||||||
/**/
|
/**/
|
||||||
29,
|
29,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user