Browse Source

Merge branch 'main' into issigkeys

Martijn Laan 4 tháng trước cách đây
mục cha
commit
1cb0740a6b

+ 1 - 0
Components/ScintEdit.pas

@@ -1287,6 +1287,7 @@ end;
 
 class function TScintEdit.GetSearchFlags(const Options: TScintFindOptions): Integer;
 begin
+  { Note: Scintilla ignores SCFIND_WHOLEWORD when SCFIND_REGEXP is set }
   Result := 0;
   if sfoMatchCase in Options then
     Result := Result or SCFIND_MATCHCASE;

+ 5 - 0
Projects/Src/Compiler.SetupCompiler.pas

@@ -311,6 +311,10 @@ type
     Name, Command: String;
   end;
 
+const
+  FileLocationEntryExtraInfoStrings = 1;
+  FileLocationEntryExtraInfoAnsiStrings = 0;
+type
   TFileLocationSign = (fsNoSetting, fsYes, fsOnce, fsCheck);
   PFileLocationEntryExtraInfo = ^TFileLocationEntryExtraInfo;
   TFileLocationEntryExtraInfo = record
@@ -8213,6 +8217,7 @@ begin
     FreeListItems(RunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
     FreeListItems(UninstallRunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
     FileLocationEntryFilenames.Clear;
+    FreeListItems(FileLocationEntryExtraInfos, FileLocationEntryExtraInfoStrings, FileLocationEntryExtraInfoAnsiStrings);
     FreeLineInfoList(ExpectedCustomMessageNames);
     FreeLangData;
     FreePreLangData;

+ 15 - 7
Projects/Src/IDE.MainForm.pas

@@ -607,7 +607,7 @@ type
     procedure UpdateCompileStatusPanels(const AProgress, AProgressMax: Cardinal;
       const ASecondsRemaining: Integer; const ABytesCompressedPerSecond: Cardinal);
     procedure UpdateEditModePanel;
-    procedure UpdateFindRegExPanel;
+    procedure UpdateFindRegExUI;
     procedure UpdatePreprocMemos;
     procedure UpdateLineMarkers(const AMemo: TIDEScintFileEdit; const Line: Integer);
     procedure UpdateImages;
@@ -895,7 +895,7 @@ constructor TMainForm.Create(AOwner: TComponent);
       UpdateNewMainFileButtons;
       UpdateKeyMapping;
       UpdateTheme;
-      UpdateFindRegExPanel;
+      UpdateFindRegExUI;
 
       { Window state }
       WindowPlacement.length := SizeOf(WindowPlacement);
@@ -3803,13 +3803,14 @@ end;
 
 function TMainForm.StoreAndTestLastFindOptions(Sender: TObject): Boolean;
 begin
-  if Sender is TFindDialog then begin
-    with Sender as TFindDialog do begin
+  { TReplaceDialog is a subclass of TFindDialog must check for TReplaceDialog first }
+  if Sender is TReplaceDialog then begin
+    with Sender as TReplaceDialog do begin
       FLastFindOptions := Options;
       FLastFindText := FindText;
     end;
   end else begin
-    with Sender as TReplaceDialog do begin
+    with Sender as TFindDialog do begin
       FLastFindOptions := Options;
       FLastFindText := FindText;
     end;
@@ -3996,7 +3997,7 @@ begin
     SendMessage(Handle, WM_SYSCOMMAND, SC_KEYMENU, Ord('r'))
   else begin
     FOptions.FindRegEx := not FOptions.FindRegEx;
-    UpdateFindRegExPanel;
+    UpdateFindRegExUI;
     var Ini := TConfigIniFile.Create;
     try
       Ini.WriteBool('Options', 'FindRegEx', FOptions.FindRegEx);
@@ -4850,11 +4851,18 @@ begin
     StatusBar.Panels[spEditMode].Text := InsertText[FActiveMemo.InsertMode];
 end;
 
-procedure TMainForm.UpdateFindRegExPanel;
+procedure TMainForm.UpdateFindRegExUI;
 const
   FindRegExText: array[Boolean] of String = ('', '.*');
 begin
   StatusBar.Panels[spFindRegEx].Text := FindRegExText[FOptions.FindRegEx];
+  if FOptions.FindRegEx then begin
+    FindDialog.Options := FindDialog.Options + [frHideWholeWord];
+    ReplaceDialog.Options := ReplaceDialog.Options + [frHideWholeWord];
+  end else begin
+    FindDialog.Options := FindDialog.Options - [frHideWholeWord];
+    ReplaceDialog.Options := ReplaceDialog.Options - [frHideWholeWord];
+  end;
 end;
 
 procedure TMainForm.UpdateMemosTabSetVisibility;