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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user