|
@@ -447,6 +447,7 @@ type
|
|
FBackNavButtonShortCut, FForwardNavButtonShortCut: TShortCut;
|
|
FBackNavButtonShortCut, FForwardNavButtonShortCut: TShortCut;
|
|
FIgnoreTabSetClick: Boolean;
|
|
FIgnoreTabSetClick: Boolean;
|
|
FSelectNextOccurrenceShortCut, FSelectAllOccurrencesShortCut: TShortCut;
|
|
FSelectNextOccurrenceShortCut, FSelectAllOccurrencesShortCut: TShortCut;
|
|
|
|
+ FSelectNextOccurrenceOptions: TScintFindOptions;
|
|
function AnyMemoHasBreakPoint: Boolean;
|
|
function AnyMemoHasBreakPoint: Boolean;
|
|
class procedure AppOnException(Sender: TObject; E: Exception);
|
|
class procedure AppOnException(Sender: TObject; E: Exception);
|
|
procedure AppOnActivate(Sender: TObject);
|
|
procedure AppOnActivate(Sender: TObject);
|
|
@@ -523,6 +524,7 @@ type
|
|
procedure ResetAllMemosLineState;
|
|
procedure ResetAllMemosLineState;
|
|
procedure StartProcess;
|
|
procedure StartProcess;
|
|
function SaveFile(const AMemo: TCompScintFileEdit; const SaveAs: Boolean): Boolean;
|
|
function SaveFile(const AMemo: TCompScintFileEdit; const SaveAs: Boolean): Boolean;
|
|
|
|
+ function SelectAllOrNextOccurrencesStart: TScintFindOptions;
|
|
procedure SetErrorLine(const AMemo: TCompScintFileEdit; const ALine: Integer);
|
|
procedure SetErrorLine(const AMemo: TCompScintFileEdit; const ALine: Integer);
|
|
procedure SetStatusPanelVisible(const AVisible: Boolean);
|
|
procedure SetStatusPanelVisible(const AVisible: Boolean);
|
|
procedure SetStepLine(const AMemo: TCompScintFileEdit; ALine: Integer);
|
|
procedure SetStepLine(const AMemo: TCompScintFileEdit; ALine: Integer);
|
|
@@ -938,6 +940,10 @@ begin
|
|
FMenuBitmapsSize.cx := 0;
|
|
FMenuBitmapsSize.cx := 0;
|
|
FMenuBitmapsSize.cy := 0;
|
|
FMenuBitmapsSize.cy := 0;
|
|
|
|
|
|
|
|
+ { Only used if a multi selection is started manually with a non-empty main
|
|
|
|
+ selection before FSelectNextOccurrenceShortCut is used }
|
|
|
|
+ FSelectNextOccurrenceOptions := GetSelTextOccurrenceFindOptions;
|
|
|
|
+
|
|
if CommandLineCompile then begin
|
|
if CommandLineCompile then begin
|
|
ReadSignTools(FSignTools);
|
|
ReadSignTools(FSignTools);
|
|
PostMessage(Handle, WM_StartCommandLineCompile, 0, 0)
|
|
PostMessage(Handle, WM_StartCommandLineCompile, 0, 0)
|
|
@@ -2514,26 +2520,33 @@ begin
|
|
FActiveMemo.SelectAll;
|
|
FActiveMemo.SelectAll;
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TCompileForm.ESelectAllOccurrencesClick(Sender: TObject);
|
|
|
|
|
|
+function TCompileForm.SelectAllOrNextOccurrencesStart: TScintFindOptions;
|
|
begin
|
|
begin
|
|
- var Options := GetSelTextOccurrenceFindOptions;
|
|
|
|
|
|
+ Result := GetSelTextOccurrenceFindOptions;
|
|
if FActiveMemo.SelEmpty then begin
|
|
if FActiveMemo.SelEmpty then begin
|
|
var Range := FActiveMemo.WordAtCursorRange;
|
|
var Range := FActiveMemo.WordAtCursorRange;
|
|
if Range.StartPos <> Range.EndPos then begin
|
|
if Range.StartPos <> Range.EndPos then begin
|
|
FActiveMemo.SetSingleSelection(Range.EndPos, Range.StartPos);
|
|
FActiveMemo.SetSingleSelection(Range.EndPos, Range.StartPos);
|
|
- Options := GetWordOccurrenceFindOptions;
|
|
|
|
|
|
+ Result := GetWordOccurrenceFindOptions;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TCompileForm.ESelectAllOccurrencesClick(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ var Options := SelectAllOrNextOccurrencesStart;
|
|
FActiveMemo.SelectAllOccurrences(Options);
|
|
FActiveMemo.SelectAllOccurrences(Options);
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TCompileForm.ESelectNextOccurrenceClick(Sender: TObject);
|
|
procedure TCompileForm.ESelectNextOccurrenceClick(Sender: TObject);
|
|
begin
|
|
begin
|
|
- { Currently this always uses GetWordOccurrenceFindOptions but ideally it would
|
|
|
|
- know whether this is the 'first' SelectNext or not. Then, if first it would
|
|
|
|
- do what SelectAll does to choose a FindOptions. And if next it would reuse
|
|
|
|
- that. This is what VSCode does. }
|
|
|
|
- FActiveMemo.SelectNextOccurrence(GetWordOccurrenceFindOptions);
|
|
|
|
|
|
+ { This is the 'first' SelectNext if there are no additional selections yet or
|
|
|
|
+ if the main selection is empty. The first SelectNext determines the find
|
|
|
|
+ options to be used for the next SelectNext. This is like VSCode as also
|
|
|
|
+ consistent with SelectAll and occurrence highlighting. }
|
|
|
|
+ if (FActiveMemo.SelectionCount = 1) or FActiveMemo.SelEmpty then
|
|
|
|
+ FSelectNextOccurrenceOptions := SelectAllOrNextOccurrencesStart;
|
|
|
|
+ FActiveMemo.SelectNextOccurrence(FSelectNextOccurrenceOptions);
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TCompileForm.ECompleteWordClick(Sender: TObject);
|
|
procedure TCompileForm.ECompleteWordClick(Sender: TObject);
|