Skip to content

Commit 2e31c5e

Browse files
committed
fix: missing selection highlighting and auto-uppercasing in data tab filter editor
1 parent 62cda84 commit 2e31c5e

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

source/main.lfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2825,6 +2825,7 @@ object MainForm: TMainForm
28252825
MouseLinkColor.Foreground = clBlue
28262826
LineHighlightColor.Background = clNone
28272827
LineHighlightColor.Foreground = clNone
2828+
OnProcessCommand = SynMemoQueryProcessCommand
28282829
OnStatusChange = SynMemoFilterStatusChange
28292830
inline SynLeftGutterPartList1: TSynGutterPartList
28302831
end

source/main.pas

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7132,14 +7132,14 @@ procedure TMainForm.SynMemoQueryProcessCommand(Sender: TObject;
71327132
TableIndex := SynSQLSynUsed.TableNames.IndexOf(Token);
71337133
if TableIndex > -1 then
71347134
Replacement := SynSQLSynUsed.TableNames[TableIndex];
7135-
Editor.BlockBegin := StartPt;
7136-
Editor.BlockEnd := EndPt;
7137-
Editor.SelText := Replacement;
7138-
7139-
Editor.CaretXY := Point(ColIdx, LineIdx);
7140-
7141-
Editor.SelText := AChar;
7142-
AChar := ''; // consume char so it is not inserted again
7135+
if Token <> Replacement then begin
7136+
Editor.BlockBegin := StartPt;
7137+
Editor.BlockEnd := EndPt;
7138+
Editor.SelText := Replacement;
7139+
Editor.CaretXY := Point(ColIdx, LineIdx);
7140+
Editor.SelText := AChar;
7141+
AChar := ''; // consume char so it is not inserted again
7142+
end;
71437143
end;
71447144
end;
71457145
end;
@@ -10183,6 +10183,9 @@ procedure TMainForm.SynMemoFilterStatusChange(Sender: TObject; Changes: TSynStat
1018310183
PanelHeight := Max(PanelHeight, btnFilterApply.Top + btnFilterApply.Height + 5);
1018410184
if PanelHeight <> pnlFilter.Height then
1018510185
pnlFilter.Height := PanelHeight;
10186+
10187+
// Required for selection highlighting
10188+
GlobalSynEditStatusChange(Sender, Changes);
1018610189
end;
1018710190

1018810191

0 commit comments

Comments
 (0)