Skip to content

Commit

Permalink
patch 8.2.4454: resetting cmdwin_type only for one situation
Browse files Browse the repository at this point in the history
Problem:    Resetting cmdwin_type only for one situation.
Solution:   Reset cmdwin_type before closing windows. (closes #9822)
  • Loading branch information
zeertzjq authored and brammool committed Feb 23, 2022
1 parent 4791fcd commit 6a8b136
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/testdir/test_exit.vim
Expand Up @@ -119,6 +119,7 @@ func Test_exit_error_reading_input()
call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew", "q:"], 'Xscript', 'b')

if RunVim([], [], '<Xscript')
call assert_equal(1, v:shell_error)
call assert_equal(['l = 1'], readfile('Xtestout'))
endif
call delete('Xscript')
Expand Down
3 changes: 0 additions & 3 deletions src/ui.c
Expand Up @@ -1065,9 +1065,6 @@ read_error_exit(void)
if (silent_mode) // Normal way to exit for "ex -s"
getout(0);
STRCPY(IObuff, _("Vim: Error reading input, exiting...\n"));
#ifdef FEAT_CMDWIN
cmdwin_type = 0;
#endif
preserve_exit();
}

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4454,
/**/
4453,
/**/
Expand Down
4 changes: 4 additions & 0 deletions src/window.c
Expand Up @@ -2856,6 +2856,10 @@ win_free_all(void)
{
int dummy;

#ifdef FEAT_CMDWIN
// avoid an error for switching tabpage with the cmdline window open
cmdwin_type = 0;
#endif
while (first_tabpage->tp_next != NULL)
tabpage_close(TRUE);

Expand Down

0 comments on commit 6a8b136

Please sign in to comment.