diff --git a/src/ce_editoroptions.pas b/src/ce_editoroptions.pas index be9cf220..4ccaec01 100644 --- a/src/ce_editoroptions.pas +++ b/src/ce_editoroptions.pas @@ -39,7 +39,7 @@ type fIdentifierMarkup: TSynSelectedColor; fFont: TFont; // - + fIdentiMatchOpts: TIdentifierMatchOptions; fLineNumEvery: Integer; fDDocDelay: Integer; fAutoDotDelay: Integer; @@ -99,6 +99,7 @@ type property highlighterGeneric: TPersistent read fTxtSyn write setTxtSyn; property shortcuts: TCollection read fShortCuts write setShortcuts; property lineNumberEvery: integer read fLineNumEvery write setLineNumEvery default 5; + property identifierMatchOptions: TIdentifierMatchOptions read fIdentiMatchOpts write fIdentiMatchOpts default [caseSensitive]; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -192,6 +193,7 @@ begin fIdentifierMarkup.Foreground:= clNone; fIdentifierMarkup.Background:= clSilver; fIdentifierMarkup.BackAlpha:=70; + fIdentiMatchOpts := [caseSensitive]; // fCompletionMenuWidth:= 160; fCompletionMenuLines:= 15; @@ -267,6 +269,7 @@ begin fTxtSyn.Assign(srcopt.fTxtSyn); background := srcopt.background; lineNumberEvery := srcopt.lineNumberEvery; + identifierMatchOptions:=srcopt.identifierMatchOptions; tabulationWidth := srcopt.tabulationWidth; blockIdentation := srcopt.blockIdentation; @@ -610,6 +613,7 @@ begin anEditor.Color := background; anEditor.RightEdge := rightEdge; anEditor.RightEdgeColor := rightEdgeColor; + anEditor.IdentifierMatchOptions:= identifierMatchOptions; for i := 0 to anEditor.Keystrokes.Count-1 do begin kst := anEditor.Keystrokes.Items[i]; diff --git a/src/ce_synmemo.pas b/src/ce_synmemo.pas index 0ef3de80..c9c2d84d 100644 --- a/src/ce_synmemo.pas +++ b/src/ce_synmemo.pas @@ -16,6 +16,13 @@ type TCESynMemo = class; + TIdentifierMatchOption = ( + caseSensitive = longInt(ssoMatchCase), + wholeWord = longInt(ssoWholeWord) + ); + + TIdentifierMatchOptions = set of TIdentifierMatchOption; + TBreakPointModification = (bpAdded, bpRemoved); // breakpoint added or removed @@ -118,6 +125,10 @@ type fImages: TImageList; fBreakPoints: TFPList; fBreakpointEvent: TBreakPointModifyEvent; + fMatchSelectionOpts: TSynSearchOptions; + fMatchIdentOpts: TSynSearchOptions; + fMatchOpts: TIdentifierMatchOptions; + procedure setMatchOpts(value: TIdentifierMatchOptions); function getMouseFileBytePos: Integer; procedure changeNotify(Sender: TObject); procedure highlightCurrentIdentifier; @@ -175,6 +186,7 @@ type function breakPointLine(index: integer): integer; property onBreakpointModify: TBreakPointModifyEvent read fBreakpointEvent write fBreakpointEvent; // + property IdentifierMatchOptions: TIdentifierMatchOptions read fMatchOpts write setMatchOpts; property Identifier: string read fIdentifier; property fileName: string read fFilename; property modified: boolean read fModified; @@ -499,6 +511,7 @@ begin HighlightAllColor.Foreground := clNone; HighlightAllColor.Background := clSilver; HighlightAllColor.BackAlpha := 70; + IdentifierMatchOptions:= [caseSensitive]; // LineHighlightColor.Background := color - $080808; LineHighlightColor.Foreground := clNone; @@ -846,9 +859,16 @@ procedure TCESynMemo.highlightCurrentIdentifier; begin fIdentifier := GetWordAtRowCol(LogicalCaretXY); if (length(fIdentifier) > 2) and (not SelAvail) then - SetHighlightSearch(fIdentifier,[ssoMatchCase]) + SetHighlightSearch(fIdentifier, fMatchIdentOpts) else if SelAvail then - SetHighlightSearch(SelText,[ssoMatchCase]); + SetHighlightSearch(SelText,fMatchSelectionOpts); +end; + +procedure TCESynMemo.setMatchOpts(value: TIdentifierMatchOptions); +begin + fMatchOpts:= value; + fMatchIdentOpts := TSynSearchOptions(fMatchOpts); + fMatchSelectionOpts:= TSynSearchOptions(fMatchOpts - [wholeWord]); end; procedure TCESynMemo.changeNotify(Sender: TObject);