diff src/normal.c @ 11436:69b52a770b29 v8.0.0602

patch 8.0.0602: when gF fails to edit the file the cursor still moves commit https://github.com/vim/vim/commit/2a79ed293c077ba791db962f0e121cf97ba4f7a7 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 24 09:51:39 2017 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Wed, 24 May 2017 10:00:03 +0200
parents b16bc115a270
children be76f4eca0d7
line wrap: on
line diff
--- 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();