Skip to content

Commit e5d5697

Browse files
committed
Added "Format Selection" tool
1 parent 32e079f commit e5d5697

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Loading

Source/cTools.pas

+18
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,23 @@ initialization
451451
ParseMessages := False;
452452
CaptureOutput := False;
453453
ConsoleHidden := True;
454+
Utf8IO := True;
455+
end;
456+
457+
with (ToolsCollection.Add as TToolItem).ExternalTool do begin
458+
Caption := _('Format Selection');
459+
Description := _('Format selected code using the "black" module');
460+
ApplicationName := '$[PythonExe-Short]';
461+
Parameters := '-m black -';
462+
ShortCut := Vcl.Menus.Shortcut(Ord('F'), [ssShift, ssAlt]);
463+
Context := tcSelectionAvailable;
464+
SaveFiles := sfNone;
465+
ProcessInput := piSelection;
466+
ProcessOutput := poSelection;
467+
ParseMessages := False;
468+
CaptureOutput := False;
469+
ConsoleHidden := True;
470+
Utf8IO := True;
454471
end;
455472

456473
with (ToolsCollection.Add as TToolItem).ExternalTool do begin
@@ -466,6 +483,7 @@ initialization
466483
ParseMessages := False;
467484
CaptureOutput := False;
468485
ConsoleHidden := True;
486+
Utf8IO := True;
469487
end;
470488

471489
with (ToolsCollection.Add as TToolItem).ExternalTool do begin

0 commit comments

Comments
 (0)