Martijn Laan 1 年之前
父節點
當前提交
70314e346d
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 8 0
      Components/ScintEdit.pas
  2. 1 1
      Projects/Src/CompForm.pas

+ 8 - 0
Components/ScintEdit.pas

@@ -256,6 +256,7 @@ type
     procedure SetBraceHighlighting(const Pos1, Pos2: Integer);
     procedure SetCursorID(const CursorID: Integer);
     procedure SetDefaultWordChars;
+    procedure SetEmptySelection;
     procedure SetEmptySelections;
     procedure SetLineIndentation(const Line, Indentation: Integer);
     procedure SetSavePoint;
@@ -1344,6 +1345,13 @@ begin
   SetWordChars(GetDefaultWordChars);
 end;
 
+procedure TScintEdit.SetEmptySelection;
+{ Make the main selection empty without scrolling the caret into view and
+  removes additional selections }
+begin
+  Call(SCI_SETEMPTYSELECTION, GetCaretPosition, 0);
+end;
+
 procedure TScintEdit.SetEmptySelections;
 { Makes all selections empty without scrolling the caret into view }
 begin

+ 1 - 1
Projects/Src/CompForm.pas

@@ -1040,7 +1040,7 @@ begin
       if FActiveMemo.SelectionCount > 1 then
         FActiveMemo.RemoveAdditionalSelections
       else if FActiveMemo.SelNotEmpty then
-        FActiveMemo.SetEmptySelections;
+        FActiveMemo.SetEmptySelection;
     end;
   end else if AShortCut = FBackNavButtonShortCut then begin
     if BackNavButton.Enabled then