Skip to content
This repository was archived by the owner on Apr 12, 2026. It is now read-only.
/ nppFSIPlugin Public archive
forked from ppv/NPPFSIPlugin

Commit 3c16cb4

Browse files
committed
Close running FSI sessions on application shutdown
Also: * don't highlight the toolbar icon unless the console has really launched successfully
1 parent aa29d5b commit 3c16cb4

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ The [FpcPipes] unit is adapted from source code believed to be in the Public Dom
6363

6464
The F# Software Foundation logo for F# is an asset of the F# Software Foundation: <https://foundation.fsharp.org/logo>
6565

66+
## License
67+
68+
[MIT]
69+
6670
[Original source code]: https://github.com/ppv/NPPFSIPlugin
71+
[MIT]: https://raw.githubusercontent.com/rdipardo/nppFSIPlugin/master/Copyright.txt
6772
[FpcPipes]: https://github.com/rdipardo/nppFSIPlugin/blob/master/Source/Plugin/Src/FpcPipes.pas
6873
[Lexilla]: https://github.com/ScintillaOrg/lexilla
6974
[Obsidian theme F# UDL]: https://gist.github.com/rdipardo/e500e0e9053e8556350802cf8ab06583

Source/Plugin/NPPFSIPlugin.lpr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ procedure beNotified(msg: PSCNotification); cdecl;
9797
NPPN_BUFFERACTIVATED, NPPN_LANGCHANGED, NPPN_WORDSTYLESUPDATED: begin
9898
TLexerProperties.SetLexer;
9999
end;
100+
NPPN_BEFORESHUTDOWN: begin
101+
if Assigned(FSIHostForm) then
102+
FSIHostForm.Close;
103+
end;
100104
end;
101105
end;
102106
/// Get the custom functions defined by the plugin.
@@ -133,8 +137,9 @@ procedure ToggleFSI; cdecl;
133137
Exit;
134138
end;
135139

136-
SendMessage(Npp.NppData._nppHandle, NPPM_SETMENUITEMCHECK, PluginFuncs[FSI_INVOKE_CMD_ID]._cmdID, 1);
137140
FSIHostForm.Show;
141+
if FSIHostForm.Visible then
142+
SendMessage(Npp.NppData._nppHandle, NPPM_SETMENUITEMCHECK, PluginFuncs[FSI_INVOKE_CMD_ID]._cmdID, 1);
138143
end;
139144
/// <summary>
140145
/// Send text from NPP to FSI.

0 commit comments

Comments
 (0)