Skip to content

Commit

Permalink
Get rid of default Ctrl+/ and Ctrl+\ with obscure function. Also add …
Browse files Browse the repository at this point in the history
…comments.
  • Loading branch information
martijnlaan committed Jun 26, 2024
1 parent 8308dee commit 4da95ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 0 additions & 6 deletions ISHelp/isetup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3188,12 +3188,6 @@ Filename: "{win}\MYPROG.INI"; Section: "InstallSettings"; Key: "InstallPath"; St
<tr>
<td>Go to next word. Shift extends selection.</td><td>Ctrl+Right</td>
</tr>
<tr>
<td>Go to previous word part. Shift extends selection.</td><td>Ctrl+/</td>
</tr>
<tr>
<td>Go to next word part. Shift extends selection.</td><td>Ctrl+\</td>
</tr>
<tr>
<td>Scroll up.</td><td>Ctrl+Up</td>
</tr>
Expand Down
6 changes: 6 additions & 0 deletions Projects/Src/CompScintEdit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ procedure TCompScintEdit.SetKeyMappingType(
AssignCmdKey(SCK_DOWN, [ssAlt], SCI_MOVESELECTEDLINESDOWN);
end;
Call(SCI_SETMOUSEMAPPING, Ord(FKeyMappingType = kmtVSCode), 0);
ClearCmdKey('/', [ssCtrl]);
ClearCmdKey('\', [ssCtrl]);
UpdateComplexCommands;
end;
end;
Expand All @@ -350,6 +352,9 @@ procedure TCompScintEdit.UpdateComplexCommands;
FComplexCommands.Clear;
FComplexCommandsReversed.Clear;

{ VK_OEM_1 is ;, VK_OEM_6 is ], VK_OEM_4 is [, VK_OEM_2 is /
See https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-layouts }

if FKeyMappingType = kmtVSCode then begin
{ Use freed Ctrl+D and Ctrl+Shift+L }
AddComplexCommand(ShortCut(KeyToKeyCode('D'), [ssCtrl]), ccSelectNextOccurrence);
Expand All @@ -364,6 +369,7 @@ procedure TCompScintEdit.UpdateComplexCommands;
AddComplexCommand(ShortCut(VK_ESCAPE, []), ccSimplifySelection);
AddComplexCommand(ShortCut(VK_OEM_6, [ssShift, ssCtrl]), ccUnfoldLine);
AddComplexCommand(ShortCut(VK_OEM_4, [ssShift, ssCtrl]), ccFoldLine);
{ Use freed Ctrl+/ }
AddComplexCommand(ShortCut(VK_OEM_2, [ssCtrl]), ccToggleLinesComment);
end;

Expand Down

0 comments on commit 4da95ec

Please sign in to comment.