1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Fix IDE 'SecondaryAllowClose' on inactive tabs

When closing secondary IDE Windows that have changes for inactive
sourceViewPanels the current logic checks 'mWidgetWindow' against
the window to decide if it should be included in the close query.
Inactive tabs always have null mWidgetWindows so the changes are
not seen. This fixes the 'Save' button case for inactive
SourceViewPanels by using per-window visitors.
This commit is contained in:
Joseph Battelle 2021-02-01 17:54:40 -08:00
parent 9fbfcb7a07
commit 21f2edd8b0

View file

@ -1243,9 +1243,9 @@ namespace IDE
List<String> changedList = scope List<String>();
defer ClearAndDeleteItems(changedList);
WithSourceViewPanels(scope (sourceViewPanel) =>
WithSourceViewPanelsOf(window, scope (sourceViewPanel) =>
{
if ((sourceViewPanel.mWidgetWindow == window) && (sourceViewPanel.HasUnsavedChanges()))
if (sourceViewPanel.HasUnsavedChanges())
{
var fileName = new String();
Path.GetFileName(sourceViewPanel.mFilePath, fileName);
@ -1260,9 +1260,9 @@ namespace IDE
bool hadError = false;
// We use a close delay after saving so the user can see we actually saved before closing down
var _this = this;
WithSourceViewPanels(scope [&] (sourceViewPanel) =>
WithSourceViewPanelsOf(window, scope [&] (sourceViewPanel) =>
{
if ((!hadError) && (sourceViewPanel.mWidgetWindow == window) && (sourceViewPanel.HasUnsavedChanges()))
if ((!hadError) && (sourceViewPanel.HasUnsavedChanges()))
if (!_this.SaveFile(sourceViewPanel))
hadError = true;
});