Skip to content

Commit a2fb2c3

Browse files
committed
- Save project session on FD close
- Restore project session if file session is not restored - Fix AS2Project display string
1 parent 6483b25 commit a2fb2c3

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

External/Plugins/ProjectManager/PluginMain.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public class PluginMain : IPlugin
9696
public static IMainForm MainForm { get { return PluginBase.MainForm; } }
9797
public static ProjectManagerSettings Settings;
9898

99-
const EventType eventMask = EventType.UIStarted | EventType.FileOpening
99+
const EventType eventMask = EventType.UIStarted | EventType.UIClosing | EventType.FileOpening
100100
| EventType.FileOpen | EventType.FileSave | EventType.FileSwitch | EventType.ProcessStart | EventType.ProcessEnd
101101
| EventType.ProcessArgs | EventType.Command | EventType.Keys | EventType.ApplySettings;
102102

@@ -371,6 +371,11 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
371371
});
372372
break;
373373

374+
case EventType.UIClosing:
375+
// save project session, documents have not been closed yet
376+
SaveProjectSession();
377+
break;
378+
374379
// replace $(SomeVariable) type stuff with things we know about
375380
case EventType.ProcessArgs:
376381
project = activeProject; // replace arguments using active project data
@@ -640,7 +645,10 @@ void SetProject(Project project, Boolean stealFocus, Boolean internalOpening)
640645
listenToPathChange = true;
641646

642647
// activate
643-
if (!internalOpening) RestoreProjectSession(project);
648+
if (!internalOpening || (internalOpening && !PluginBase.Settings.RestoreFileSession))
649+
{
650+
RestoreProjectSession(project);
651+
}
644652

645653
if (stealFocus)
646654
{

External/Plugins/ProjectManager/Projects/AS2/AS2Project.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public AS2Project(string path)
1414
}
1515

1616
public override string Language { get { return "as2"; } }
17-
public override string LanguageDisplayName { get { return "AS3"; } }
17+
public override string LanguageDisplayName { get { return "AS2"; } }
1818
public override bool IsCompilable { get { return true; } }
1919
public override bool UsesInjection { get { return InputPath != ""; } }
2020
public override bool HasLibraries { get { return OutputType == OutputType.Application && !UsesInjection; } }

PluginCore/PluginCore/Interfaces.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ public interface ISettings
232232
Boolean DisableFindTextUpdating { get; set; }
233233
Boolean ApplyFileExtension { get; set; }
234234
Boolean RestoreFileStates { get; set; }
235+
Boolean RestoreFileSession { get; set; }
235236
Boolean BackSpaceUnIndents { get; set; }
236237
Boolean BraceMatchingEnabled { get; set; }
237238
Boolean CaretLineVisible { get; set; }

0 commit comments

Comments
 (0)