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:
14
src/window.c
14
src/window.c
@@ -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();
|
||||
|
Reference in New Issue
Block a user