1
0
forked from aniani/vim

patch 7.4.1956

Problem:    When using CTRL-W f and pressing "q" at the ATTENTION dialog the
            newly opened window is not closed.
Solution:   Close the window and go back to the original one. (Norio Takagi,
            Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2016-06-26 17:11:21 +02:00
parent f4fba6dcd5
commit 5d2ca04029
3 changed files with 46 additions and 3 deletions

View File

@@ -475,6 +475,8 @@ wingotofile:
ptr = grab_file_name(Prenum1, &lnum);
if (ptr != NULL)
{
tabpage_T *oldtab = curtab;
win_T *oldwin = curwin;
# ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
@@ -482,9 +484,15 @@ wingotofile:
if (win_split(0, 0) == OK)
{
RESET_BINDING(curwin);
(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL,
ECMD_HIDE, NULL);
if (nchar == 'F' && lnum >= 0)
if (do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL,
ECMD_HIDE, NULL) == FAIL)
{
/* Failed to open the file, close the window
* opened for it. */
win_close(curwin, FALSE);
goto_tabpage_win(oldtab, oldwin);
}
else if (nchar == 'F' && lnum >= 0)
{
curwin->w_cursor.lnum = lnum;
check_cursor_lnum();