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 f2c029d

Browse files
committed
New option: start dotnet fsi with command-line arguments
Also: * let the INI file class constructor create a missing config * make the INI file path less verbose * simplify file path construction * make the style of URL labels more dynamic
1 parent 642ba1b commit f2c029d

8 files changed

Lines changed: 130 additions & 106 deletions

File tree

Source/Plugin/Forms/AboutForm.lfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ object FrmAbout: TFrmAbout
3434
BorderSpacing.Bottom = 16
3535
Caption = '%s'
3636
Font.Color = clHighlight
37-
Font.Style = [fsUnderline]
37+
Font.Style = []
3838
OnClick = lblRepoClick
3939
OnMouseEnter = lblRepoMouseEnter
4040
OnMouseLeave = lblRepoMouseLeave

Source/Plugin/Forms/AboutForm.pas

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ constructor TFrmAbout.Create(AOwner: TComponent);
9090
procedure TFrmAbout.lblRepoClick(Sender: TObject);
9191
begin
9292
ShellAPI.ShellExecute(0, 'Open', PChar(TLabel(Sender).Caption), Nil, Nil, SW_SHOWNORMAL);
93+
ModalResult := mrCancel;
9394
end;
9495

9596
procedure TFrmAbout.btnOKClick({%H-}Sender: TObject);
@@ -100,11 +101,19 @@ procedure TFrmAbout.btnOKClick({%H-}Sender: TObject);
100101
procedure TFrmAbout.lblRepoMouseEnter(Sender: TObject);
101102
begin
102103
TLabel(Sender).Cursor := crHandPoint;
104+
TLabel(Sender).Font.Style := [fsUnderline];
105+
if Npp.IsDarkModeEnabled then
106+
TLabel(Sender).Font.Color := TColor(DMF_COLOR_URL_ACTIVE);
103107
end;
104108

105109
procedure TFrmAbout.lblRepoMouseLeave(Sender: TObject);
106110
begin
107111
TLabel(Sender).Cursor := crDefault;
112+
TLabel(Sender).Font.Style := [];
113+
if Npp.IsDarkModeEnabled then
114+
TLabel(Sender).Font.Color := TColor(DMF_COLOR_URL)
115+
else
116+
TLabel(Sender).Font.Color := clHighlight;
108117
end;
109118

110119
procedure TFrmAbout.SubclassAndTheme(DmfMask: Cardinal);

Source/Plugin/Forms/ConfigForm.lfm

Lines changed: 82 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,89 @@
11
object FrmConfiguration: TFrmConfiguration
2-
Left = 595
3-
Height = 408
4-
Top = 127
2+
Left = 558
3+
Height = 435
4+
Top = 211
55
Width = 913
66
BorderIcons = [biSystemMenu]
77
BorderStyle = bsDialog
88
Caption = 'Configuration'
9-
ClientHeight = 408
9+
ClientHeight = 435
1010
ClientWidth = 913
11-
Color = clBtnFace
1211
DesignTimePPI = 144
13-
Font.Color = clWindowText
14-
Font.Height = -17
15-
Position = poScreenCenter
1612
OnShow = FormShow
17-
object pnlBase: TPanel
13+
Position = poScreenCenter
14+
object pnlBase: TPanel[0]
1815
Left = 0
19-
Height = 408
16+
Height = 435
2017
Top = 0
2118
Width = 913
2219
Align = alClient
2320
BevelOuter = bvNone
24-
ClientHeight = 408
21+
ClientHeight = 435
2522
ClientWidth = 913
2623
ParentBackground = False
24+
TabOrder = 0
2725
object grpFSISettings: TGroupBox
2826
Left = 12
29-
Height = 163
27+
Height = 190
3028
Top = 10
3129
Width = 888
3230
Anchors = [akTop, akLeft, akRight]
3331
Caption = 'FSI'
34-
ClientHeight = 137
32+
ClientHeight = 165
3533
ClientWidth = 884
3634
ParentBackground = False
35+
TabOrder = 2
3736
object pnlCustomFSI: TPanel
38-
Left = 5
37+
Left = 0
3938
Height = 85
40-
Top = 38
39+
Top = 68
4140
Width = 874
4241
BevelOuter = bvNone
4342
ClientHeight = 85
4443
ClientWidth = 874
4544
ParentBackground = False
46-
TabOrder = 0
45+
TabOrder = 1
4746
object lblFSIBinaryArgs: TLabel
48-
Left = 24
49-
Height = 21
50-
Top = 54
51-
Width = 87
47+
Left = 18
48+
Height = 20
49+
Top = 48
50+
Width = 82
5251
Caption = 'Arguments:'
5352
Enabled = False
5453
ParentColor = False
5554
end
5655
object lblFSIBinaryPath: TLabel
57-
Left = 19
58-
Height = 21
56+
Left = 18
57+
Height = 20
5958
Top = 12
60-
Width = 90
59+
Width = 85
6160
Caption = 'Binary Path:'
6261
Enabled = False
6362
ParentColor = False
6463
end
6564
object txtFSIBinary: TEdit
6665
Left = 118
67-
Height = 29
66+
Height = 28
67+
Hint = 'Full file path of fsi.exe'
6868
Top = 10
6969
Width = 701
7070
Anchors = [akTop, akLeft, akRight]
7171
Enabled = False
72-
TabOrder = 1
73-
Hint = 'Full file path of fsi.exe'
72+
ParentShowHint = False
7473
ShowHint = True
74+
TabOrder = 1
7575
end
7676
object txtFSIBinaryArgs: TEdit
7777
Left = 118
78-
Height = 29
78+
Height = 28
79+
Hint = 'Command-line arguments for fsi.exe'
7980
Top = 48
8081
Width = 701
8182
Anchors = [akTop, akLeft, akRight]
8283
Enabled = False
83-
TabOrder = 2
84-
Hint = 'Command-line arguments for fsi.exe'
84+
ParentShowHint = False
8585
ShowHint = True
86+
TabOrder = 2
8687
end
8788
object cmdSelectBinary: TButton
8889
Left = 829
@@ -109,15 +110,15 @@ object FrmConfiguration: TFrmConfiguration
109110
object lblDotnetSdkSite: TLabel
110111
Left = 314
111112
Height = 29
112-
Top = 2
113+
Top = 4
113114
Width = 346
114115
Alignment = taRightJustify
115116
AutoSize = False
116117
Caption = 'https://dotnet.microsoft.com/en-us/download'
117118
Font.Color = clHighlight
118119
Font.Height = -17
119120
Font.Name = 'Tahoma'
120-
Font.Style = [fsUnderline]
121+
Font.Style = []
121122
ParentColor = False
122123
ParentFont = False
123124
OnClick = lblDotnetSdkSiteClick
@@ -138,18 +139,30 @@ object FrmConfiguration: TFrmConfiguration
138139
ParentFont = False
139140
State = cbChecked
140141
TabOrder = 0
141-
OnClick = chkUseDotnetFsiClick
142+
OnChange = chkUseDotnetFsiClick
142143
end
143144
end
145+
object chkPassArgsToDotnetFsi: TCheckBox
146+
Left = 24
147+
Height = 25
148+
Top = 40
149+
Width = 238
150+
Caption = 'Pass arguments to dotnet fsi'
151+
Font.Height = -17
152+
Font.Name = 'Tahoma'
153+
ParentFont = False
154+
TabOrder = 2
155+
OnChange = chkUseArgsChanged
156+
end
144157
end
145158
object grpEditorSettings: TGroupBox
146159
Left = 12
147-
Height = 161
148-
Top = 182
160+
Height = 164
161+
Top = 208
149162
Width = 391
150163
Anchors = [akTop, akLeft, akRight, akBottom]
151164
Caption = 'Editor'
152-
ClientHeight = 135
165+
ClientHeight = 164
153166
ClientWidth = 387
154167
ParentBackground = False
155168
TabOrder = 3
@@ -165,15 +178,15 @@ object FrmConfiguration: TFrmConfiguration
165178
TabOrder = 1
166179
object lblTabLength: TLabel
167180
Left = 5
168-
Height = 21
181+
Height = 20
169182
Top = 2
170-
Width = 89
183+
Width = 85
171184
Caption = 'Tab Length:'
172185
ParentColor = False
173186
end
174187
object txtTabLength: TEdit
175188
Left = 132
176-
Height = 29
189+
Height = 28
177190
Top = 0
178191
Width = 46
179192
MaxLength = 2
@@ -182,7 +195,7 @@ object FrmConfiguration: TFrmConfiguration
182195
end
183196
object updnTabLength: TUpDown
184197
Left = 178
185-
Height = 29
198+
Height = 28
186199
Top = 0
187200
Width = 35
188201
Associate = txtTabLength
@@ -195,29 +208,29 @@ object FrmConfiguration: TFrmConfiguration
195208
end
196209
object chkConvertToTabs: TCheckBox
197210
Left = 24
198-
Height = 25
211+
Height = 24
199212
Top = 12
200-
Width = 195
213+
Width = 188
201214
Caption = 'Convert tabs to spaces'
202215
TabOrder = 0
203-
OnClick = chkConvertToTabsClick
216+
OnChange = chkConvertToTabsClick
204217
OnKeyUp = chkConvertToTabsKeyUp
205218
end
206219
object chkEchoText: TCheckBox
207220
Left = 24
208-
Height = 25
221+
Height = 24
209222
Top = 95
210-
Width = 234
223+
Width = 223
211224
Caption = 'Echo text from NPP in editor'
212225
TabOrder = 2
213-
OnClick = chkConvertToTabsClick
226+
OnChange = chkConvertToTabsClick
214227
OnKeyUp = chkConvertToTabsKeyUp
215228
end
216229
end
217230
object cmdSave: TButton
218-
Left = 672
231+
Left = 656
219232
Height = 38
220-
Top = 352
233+
Top = 380
221234
Width = 113
222235
Anchors = [akRight, akBottom]
223236
Caption = 'Save'
@@ -227,9 +240,9 @@ object FrmConfiguration: TFrmConfiguration
227240
OnClick = cmdSaveClick
228241
end
229242
object cmdCancel: TButton
230-
Left = 787
243+
Left = 784
231244
Height = 38
232-
Top = 352
245+
Top = 380
233246
Width = 113
234247
Anchors = [akRight, akBottom]
235248
Cancel = True
@@ -240,87 +253,87 @@ object FrmConfiguration: TFrmConfiguration
240253
end
241254
object grpLexerProps: TGroupBox
242255
Left = 413
243-
Height = 161
244-
Top = 182
256+
Height = 164
257+
Top = 208
245258
Width = 487
246259
Anchors = [akTop, akLeft, akRight, akBottom]
247260
Caption = 'Source Code Folding'
248-
ClientHeight = 135
261+
ClientHeight = 164
249262
ClientWidth = 483
250263
ParentBackground = False
251264
TabOrder = 4
252265
object pnlFoldOptions: TPanel
253266
Left = 0
254-
Height = 124
267+
Height = 108
255268
Top = 10
256269
Width = 478
257270
BevelOuter = bvNone
258-
ClientHeight = 124
271+
ClientHeight = 108
259272
ClientWidth = 478
260273
ParentBackground = False
261274
TabOrder = 0
262275
object chkFoldComments: TCheckBox
263276
Left = 10
264-
Height = 25
277+
Height = 24
265278
Top = 38
266-
Width = 138
279+
Width = 134
267280
Caption = 'Fold comments'
268281
TabOrder = 1
269282
OnChange = updateFoldingOption
270283
end
271284
object chkFoldMultiLineComments: TCheckBox
272285
Left = 10
273-
Height = 25
286+
Height = 24
274287
Top = 77
275-
Width = 169
288+
Width = 162
276289
Caption = 'Fold line comments'
277290
TabOrder = 2
278291
OnChange = updateFoldingOption
279292
end
280293
object chkFoldOpenStatements: TCheckBox
281294
Left = 202
282-
Height = 25
295+
Height = 24
283296
Top = 38
284-
Width = 200
297+
Width = 192
285298
Caption = 'Fold "open" statements'
286299
TabOrder = 4
287300
OnChange = updateFoldingOption
288301
end
289302
object chkFoldPreprocessor: TCheckBox
290303
Left = 202
291-
Height = 25
304+
Height = 24
292305
Top = 77
293-
Width = 233
306+
Width = 223
294307
Caption = 'Fold preprocessor directives'
295308
TabOrder = 5
296309
OnChange = updateFoldingOption
297310
end
298311
object chkFoldCompact: TCheckBox
299312
Left = 202
300-
Height = 25
313+
Height = 24
301314
Top = 0
302-
Width = 146
315+
Width = 139
303316
Caption = 'Fold empty lines'
304317
TabOrder = 3
305318
OnChange = updateFoldingOption
306319
end
307320
object chkFolding: TCheckBox
308321
Left = 10
309-
Height = 25
322+
Height = 24
310323
Top = 0
311-
Width = 129
324+
Width = 126
312325
Caption = 'Enable folding'
313326
TabOrder = 0
314327
OnChange = chkFoldingChange
315328
end
316329
end
317330
end
318331
end
319-
object dlgFSIBinarySelect: TOpenDialog
332+
object dlgFSIBinarySelect: TOpenDialog[1]
320333
DefaultExt = '.exe'
321334
Filter = 'EXE|*.exe;*.bat;*.cmd'
322335
Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing, ofDontAddToRecent]
323-
Left = 19
324-
Top = 346
336+
Left = 16
337+
Top = 392
325338
end
326339
end

0 commit comments

Comments
 (0)