From 7c7dcd8fccdddceacc05ee0fd4cf75e22165d439 Mon Sep 17 00:00:00 2001 From: eljefe7000 Date: Sun, 16 Aug 2020 09:58:22 -0400 Subject: [PATCH] Fix an issue in Window dialog The bug: after closing last file opened in 2nd view in Window sialog, the last file opened in 2nd view in Notepad++ is closed, but remain in Window dialog. This PR is a workaround solution to close Window dialog if the last document is closed. Fix #8697, close #8721 --- PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp index 38981fc70..d5d730741 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp @@ -848,7 +848,9 @@ void WindowsDlg::doClose() } delete[] nmdlg.Items; - if (_pTab->nbItem() != _idxMap.size()) + if (_idxMap.size() < 1) + ::SendMessage(_hSelf, WM_CLOSE, 0, 0); + else if (_pTab->nbItem() != _idxMap.size()) doRefresh(true); else {