Ver código fonte

Shortcuts Alt+Left and Alt+Right now always navigate back and forward even if Visual Studio-style shortcuts have been activated. This is because VSCode has same menu shortcuts as Visual Studio keymap, except for these two.

Martijn Laan 1 ano atrás
pai
commit
2c3e1f0ce2
2 arquivos alterados com 10 adições e 7 exclusões
  1. 9 7
      Projects/Src/CompForm.pas
  2. 1 0
      whatsnew.htm

+ 9 - 7
Projects/Src/CompForm.pas

@@ -452,6 +452,7 @@ type
     FNavStacks: TCompScintEditNavStacks;
     FCurrentNavItem: TCompScintEditNavItem;
     FBackNavButtonShortCut, FForwardNavButtonShortCut: TShortCut;
+    FBackNavButtonShortCut2, FForwardNavButtonShortCut2: TShortCut;
     FIgnoreTabSetClick: Boolean;
     FSelectNextOccurrenceShortCut, FSelectAllOccurrencesShortCut: TShortCut;
     FFirstTabSelectShortCut, FLastTabSelectShortCut: TShortCut;
@@ -1092,11 +1093,13 @@ begin
     Key := 0;
     if ESelectAllOccurrences.Enabled then
       ESelectAllOccurrencesClick(Self);
-  end else if AShortCut = FBackNavButtonShortCut then begin
+  end else if (AShortCut = FBackNavButtonShortCut) or
+              ((FBackNavButtonShortCut2 <> 0) and (AShortCut = FBackNavButtonShortCut2)) then begin
     Key := 0;
     if BackNavButton.Enabled then
       BackNavButtonClick(Self);
-  end else if AShortCut = FForwardNavButtonShortCut then begin
+  end else if (AShortCut = FForwardNavButtonShortCut) or
+              ((FForwardNavButtonShortCut2 <> 0) and (AShortCut = FForwardNavButtonShortCut2)) then begin
     Key := 0;
     if ForwardNavButton.Enabled then
       ForwardNavButtonClick(Self);
@@ -1157,11 +1160,6 @@ begin
         HtmlHelp(GetDesktopWindow, PChar(HelpFile), HH_KEYWORD_LOOKUP, DWORD(@KLink));
       end;
     end;
-  end
-  else if ((Key = VK_RIGHT) and (Shift * [ssShift, ssAlt, ssCtrl] = [ssAlt])) and
-           (ShortCut(Key, Shift) <> FForwardNavButtonShortCut) then begin
-    InitiateAutoComplete(#0);
-    Key := 0;
   end;
 end;
 
@@ -5431,12 +5429,16 @@ begin
     kmtDelphi:
       begin
         FBackNavButtonShortCut := ShortCut(VK_LEFT, [ssAlt]);
+        FBackNavButtonShortCut2 := 0;
         FForwardNavButtonShortCut := ShortCut(VK_RIGHT, [ssAlt]);
+        FForwardNavButtonShortCut2 := 0;
       end;
     kmtVisualStudio:
       begin
         FBackNavButtonShortCut := ShortCut(VK_OEM_MINUS, [ssCtrl]);
+        FBackNavButtonShortCut2 := ShortCut(VK_LEFT, [ssAlt]);
         FForwardNavButtonShortCut := ShortCut(VK_OEM_MINUS, [ssCtrl, ssShift]);
+        FForwardNavButtonShortCut2 := ShortCut(VK_RIGHT, [ssAlt]);
       end;
   else
     raise Exception.Create('Unknown FOptions.KeyMappingType');

+ 1 - 0
whatsnew.htm

@@ -57,6 +57,7 @@ For conditions of distribution and use, see <a href="files/is/license.txt">LICEN
 </ul>
 <p>Other changes:</p>
 <ul>
+  <li>Shortcuts Alt+Left and Alt+Right now always navigate back and forward even if Visual Studio-style shortcuts have been activated.<br />Because of this Alt+Right can no longer be used to initiate auto complete, instead the existing Ctrl+Space or Ctrl+I alternatives must be used.</li>
   <li>Moved the list of recently opened files into a new <i>Open Recent</i> submenu of the <i>Files</i> menu.</li>
   <li>Added shortcuts to select a tab (Ctrl+1 through Ctrl+9).</li>
   <li>Added new <i>Word Wrap</i> menu item in the <i>View</i> menu (Alt+Z).</li>