0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.0.0602: when gF fails to edit the file the cursor still moves

Problem:    When gF fails to edit the file the cursor still moves to the found
            line number.
Solution:   Check the return value of do_ecmd(). (Michael Hwang)
This commit is contained in:
Bram Moolenaar
2017-05-24 09:51:39 +02:00
parent 545cb79da5
commit 2a79ed293c
3 changed files with 28 additions and 5 deletions

View File

@@ -6250,9 +6250,9 @@ nv_gotofile(cmdarg_T *cap)
if (curbufIsChanged() && curbuf->b_nwindows <= 1 && !P_HID(curbuf))
(void)autowrite(curbuf, FALSE);
setpcmark();
(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
P_HID(curbuf) ? ECMD_HIDE : 0, curwin);
if (cap->nchar == 'F' && lnum >= 0)
if (do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
P_HID(curbuf) ? ECMD_HIDE : 0, curwin) == OK
&& cap->nchar == 'F' && lnum >= 0)
{
curwin->w_cursor.lnum = lnum;
check_cursor_lnum();