diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-05-24 09:51:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-05-24 09:51:39 +0200 |
commit | 2a79ed293c077ba791db962f0e121cf97ba4f7a7 (patch) | |
tree | 65412b41e41eedd2ba9674575d97a3504d3047eb /src/normal.c | |
parent | 545cb79da586be3333a0a55616046f94b01f6b1a (diff) | |
download | vim-git-2a79ed293c077ba791db962f0e121cf97ba4f7a7.tar.gz |
patch 8.0.0602: when gF fails to edit the file the cursor still movesv8.0.0602
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)
Diffstat (limited to 'src/normal.c')
-rw-r--r-- | src/normal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/normal.c b/src/normal.c index 25c0986b4..9a1226772 100644 --- a/src/normal.c +++ b/src/normal.c @@ -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(); |