comparison 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
comparison
equal deleted inserted replaced
11435:e97a062b6065 11436:69b52a770b29
6248 { 6248 {
6249 /* do autowrite if necessary */ 6249 /* do autowrite if necessary */
6250 if (curbufIsChanged() && curbuf->b_nwindows <= 1 && !P_HID(curbuf)) 6250 if (curbufIsChanged() && curbuf->b_nwindows <= 1 && !P_HID(curbuf))
6251 (void)autowrite(curbuf, FALSE); 6251 (void)autowrite(curbuf, FALSE);
6252 setpcmark(); 6252 setpcmark();
6253 (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST, 6253 if (do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
6254 P_HID(curbuf) ? ECMD_HIDE : 0, curwin); 6254 P_HID(curbuf) ? ECMD_HIDE : 0, curwin) == OK
6255 if (cap->nchar == 'F' && lnum >= 0) 6255 && cap->nchar == 'F' && lnum >= 0)
6256 { 6256 {
6257 curwin->w_cursor.lnum = lnum; 6257 curwin->w_cursor.lnum = lnum;
6258 check_cursor_lnum(); 6258 check_cursor_lnum();
6259 beginline(BL_SOL | BL_FIX); 6259 beginline(BL_SOL | BL_FIX);
6260 } 6260 }