Martijn Laan 1 year ago
parent
commit
70314e346d
2 changed files with 9 additions and 1 deletions
  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 SetBraceHighlighting(const Pos1, Pos2: Integer);
     procedure SetCursorID(const CursorID: Integer);
     procedure SetCursorID(const CursorID: Integer);
     procedure SetDefaultWordChars;
     procedure SetDefaultWordChars;
+    procedure SetEmptySelection;
     procedure SetEmptySelections;
     procedure SetEmptySelections;
     procedure SetLineIndentation(const Line, Indentation: Integer);
     procedure SetLineIndentation(const Line, Indentation: Integer);
     procedure SetSavePoint;
     procedure SetSavePoint;
@@ -1344,6 +1345,13 @@ begin
   SetWordChars(GetDefaultWordChars);
   SetWordChars(GetDefaultWordChars);
 end;
 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;
 procedure TScintEdit.SetEmptySelections;
 { Makes all selections empty without scrolling the caret into view }
 { Makes all selections empty without scrolling the caret into view }
 begin
 begin

+ 1 - 1
Projects/Src/CompForm.pas

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