编辑器

语法高亮
This commit is contained in:
JianjunLiu 2023-04-11 14:51:40 +08:00
parent c3e7ddbc9f
commit 06c5a3f1d5
1 changed files with 7 additions and 3 deletions

View File

@ -637,7 +637,7 @@ type TTslSynHighLighter = class(TSynHighLighter)
begin begin
idx := b; idx := b;
ttk := ""; ttk := "";
jsfh := " \t`~!#$%^&*()+[]{}|\\/?><.,=:"; jsfh := " \t`~!#$%^&*()+[]{}|\\/?><.,=:;";
if cst=0 then if cst=0 then
begin begin
while idx<=e do while idx<=e do
@ -651,8 +651,10 @@ type TTslSynHighLighter = class(TSynHighLighter)
SetJsToken(tokens,"<!--",idx+3,"/*"); SetJsToken(tokens,"<!--",idx+3,"/*");
return ParserTslxTokenLines(s,idx+4,e,"<!--",tokens); return ParserTslxTokenLines(s,idx+4,e,"<!--",tokens);
end end
isjsfh := false;
if pos(vi,jsfh) then if pos(vi,jsfh) then
begin begin
isjsfh := true;
if ttk then if ttk then
SetJsToken(tokens,ttk,idx-1); SetJsToken(tokens,ttk,idx-1);
end end
@ -757,9 +759,11 @@ type TTslSynHighLighter = class(TSynHighLighter)
end end
SetJsToken(tokens,vi,idx); SetJsToken(tokens,vi,idx);
end else end else
if pos(vi,jsfh) then if {pos(vi,jsfh)}isjsfh then
begin begin
SetJsToken(tokens,vi,idx); td := SetJsToken(tokens,vi,idx);
if td and hightercolor then
td.FFcolor := hightercolor.symcolor()
end else end else
begin begin
ttk+=vi; ttk+=vi;