synedit: dont highlight a line when highlight has not colors set

git-svn-id: trunk@17545 -
This commit is contained in:
paul 2008-11-23 13:06:01 +00:00
parent 177d9aa195
commit 285687c543

View File

@ -46,6 +46,7 @@ type
FHighlightedLine: Integer;
protected
procedure DoMarkupLineHighlightInfoChange(Sender: TObject);
function HasLineHighlight: Boolean;
public
constructor Create(ASynEdit: TCustomControl);
destructor Destroy; override;
@ -77,6 +78,13 @@ begin
InvalidateSynLines(FHighlightedLine, FHighlightedLine);
end;
function TSynEditMarkupSpecialLine.HasLineHighlight: Boolean;
begin
Result :=
(FMarkupLineHighlightInfo.Background <> clNone) or
(FMarkupLineHighlightInfo.Foreground <> clNone);
end;
constructor TSynEditMarkupSpecialLine.Create(ASynEdit: TCustomControl);
begin
inherited Create(ASynEdit);
@ -125,7 +133,7 @@ begin
// if it is so then use own bg,fg colors to setup highlight
if not FSpecialLine then
begin
if FHighlightedLine = ARow then
if (FHighlightedLine = ARow) and HasLineHighlight then
begin
FSpecialLine := True;
MarkupInfo.Foreground := FMarkupLineHighlightInfo.Foreground;