mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +00:00
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:
@@ -24076,7 +24076,7 @@ void option_last_set_msg(LastSet last_set)
|
|||||||
MSG_PUTS(_("\n\tLast set from "));
|
MSG_PUTS(_("\n\tLast set from "));
|
||||||
MSG_PUTS(p);
|
MSG_PUTS(p);
|
||||||
if (last_set.script_ctx.sc_lnum > 0) {
|
if (last_set.script_ctx.sc_lnum > 0) {
|
||||||
MSG_PUTS(_(" line "));
|
MSG_PUTS(_(line_msg));
|
||||||
msg_outnum((long)last_set.script_ctx.sc_lnum);
|
msg_outnum((long)last_set.script_ctx.sc_lnum);
|
||||||
}
|
}
|
||||||
if (should_free) {
|
if (should_free) {
|
||||||
|
@@ -2732,16 +2732,7 @@ varnumber_T tv_get_number_chk(const typval_T *const tv, bool *const ret_error)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
case VAR_SPECIAL: {
|
case VAR_SPECIAL: {
|
||||||
switch (tv->vval.v_special) {
|
return tv->vval.v_special == kSpecialVarTrue ? 1 : 0;
|
||||||
case kSpecialVarTrue: {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
case kSpecialVarFalse:
|
|
||||||
case kSpecialVarNull: {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case VAR_UNKNOWN: {
|
case VAR_UNKNOWN: {
|
||||||
emsgf(_(e_intern2), "tv_get_number(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 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 "));
|
||||||
|
|
||||||
// For undo we need to know the lowest time possible.
|
// For undo we need to know the lowest time possible.
|
||||||
EXTERN time_t starttime;
|
EXTERN time_t starttime;
|
||||||
|
|
||||||
|
@@ -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')
|
||||||
|
@@ -6020,10 +6020,20 @@ file_name_in_line (
|
|||||||
|
|
||||||
if (file_lnum != NULL) {
|
if (file_lnum != NULL) {
|
||||||
char_u *p;
|
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.
|
// 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) {
|
||||||
if (!isdigit(*p)) {
|
if (!isdigit(*p)) {
|
||||||
p++; // skip the separator
|
p++; // skip the separator
|
||||||
|
Reference in New Issue
Block a user