To: vim_dev@googlegroups.com Subject: Patch 8.2.0030 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0030 Problem: "gF" does not work on output of "verbose command". Solution: Recognize " line " and translations. (closes #5391) Files: src/globals.h, src/eval.c, src/findfile.c, src/testdir/test_gf.vim *** ../vim-8.2.0029/src/globals.h 2019-11-30 22:40:44.000000000 +0100 --- src/globals.h 2019-12-22 15:25:56.745094120 +0100 *************** *** 1660,1665 **** --- 1660,1667 ---- 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 ")); + #ifdef FEAT_CRYPT EXTERN char need_key_msg[] INIT(= N_("Need encryption key for \"%s\"")); #endif *** ../vim-8.2.0029/src/eval.c 2019-12-08 18:34:52.000000000 +0100 --- src/eval.c 2019-12-22 15:21:28.721945523 +0100 *************** *** 5462,5468 **** break; case VAR_SPECIAL: return varp->vval.v_number == VVAL_TRUE ? 1 : 0; - break; case VAR_JOB: #ifdef FEAT_JOB_CHANNEL emsg(_("E910: Using a Job as a Number")); --- 5462,5467 ---- *************** *** 6147,6153 **** msg_puts((char *)p); if (script_ctx.sc_lnum > 0) { ! msg_puts(_(" line ")); msg_outnum((long)script_ctx.sc_lnum); } verbose_leave(); --- 6146,6152 ---- msg_puts((char *)p); if (script_ctx.sc_lnum > 0) { ! msg_puts(_(line_msg)); msg_outnum((long)script_ctx.sc_lnum); } verbose_leave(); *** ../vim-8.2.0029/src/findfile.c 2019-12-01 21:36:43.000000000 +0100 --- src/findfile.c 2019-12-22 15:27:08.096863970 +0100 *************** *** 2047,2056 **** if (file_lnum != NULL) { char_u *p; ! // Get the number after the file name and a separator character p = ptr + len; ! p = skipwhite(p); if (*p != NUL) { if (!isdigit(*p)) --- 2047,2065 ---- if (file_lnum != NULL) { char_u *p; + char *line_english = " line "; + 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; ! 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)) *** ../vim-8.2.0029/src/testdir/test_gf.vim 2019-11-08 21:49:06.000000000 +0100 --- src/testdir/test_gf.vim 2019-12-22 15:35:55.339121939 +0100 *************** *** 58,63 **** --- 58,71 ---- 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') *** ../vim-8.2.0029/src/version.c 2019-12-21 22:21:57.388252299 +0100 --- src/version.c 2019-12-22 15:22:40.061721303 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 30, /**/ -- Apologies for taking up the bandwidth with the apology. Anything else I can apologise for ...... er no can't think of anything, sorry about that. Andy Hunt (Member of British Olympic Apology Squad) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///