vim-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 vim/vim#5391)
64e74c9cc7
This commit is contained in:
parent
bc8da6cdbe
commit
80ebfc304e
|
@ -24076,7 +24076,7 @@ void option_last_set_msg(LastSet last_set)
|
|||
MSG_PUTS(_("\n\tLast set from "));
|
||||
MSG_PUTS(p);
|
||||
if (last_set.script_ctx.sc_lnum > 0) {
|
||||
MSG_PUTS(_(" line "));
|
||||
MSG_PUTS(_(line_msg));
|
||||
msg_outnum((long)last_set.script_ctx.sc_lnum);
|
||||
}
|
||||
if (should_free) {
|
||||
|
|
|
@ -2732,16 +2732,7 @@ varnumber_T tv_get_number_chk(const typval_T *const tv, bool *const ret_error)
|
|||
return n;
|
||||
}
|
||||
case VAR_SPECIAL: {
|
||||
switch (tv->vval.v_special) {
|
||||
case kSpecialVarTrue: {
|
||||
return 1;
|
||||
}
|
||||
case kSpecialVarFalse:
|
||||
case kSpecialVarNull: {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
return tv->vval.v_special == kSpecialVarTrue ? 1 : 0;
|
||||
}
|
||||
case VAR_UNKNOWN: {
|
||||
emsgf(_(e_intern2), "tv_get_number(UNKNOWN)");
|
||||
|
|
|
@ -1059,6 +1059,8 @@ EXTERN char_u e_floatexchange[] INIT(=N_(
|
|||
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 line_msg[] INIT(= N_(" line "));
|
||||
|
||||
// For undo we need to know the lowest time possible.
|
||||
EXTERN time_t starttime;
|
||||
|
||||
|
|
|
@ -58,6 +58,14 @@ func Test_gF()
|
|||
call assert_equal('Xfile', bufname('%'))
|
||||
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&
|
||||
call delete('Xfile')
|
||||
call delete('Xfile2')
|
||||
|
|
|
@ -6020,10 +6020,20 @@ file_name_in_line (
|
|||
|
||||
if (file_lnum != NULL) {
|
||||
char_u *p;
|
||||
const char *line_english = " line ";
|
||||
const char *line_transl = _(line_msg);
|
||||
|
||||
// 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 = skipwhite(p);
|
||||
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);
|
||||
}
|
||||
if (*p != NUL) {
|
||||
if (!isdigit(*p)) {
|
||||
p++; // skip the separator
|
||||
|
|
Loading…
Reference in New Issue