user1374768
user1374768

Reputation: 408

How to properly setup Scintilla keyword highlighting?

I use Scintilla component with DScintilla wrapper and get error with keyword highlighting in any lexer. Pascal, for example:

with DScintilla do 
begin
  SetLexer(SCLEX_PASCAL);
  StyleSetFore(SCE_PAS_WORD, clGreen);
  StyleSetFore(SCE_PAS_OPERATOR, clRed);;
  StyleSetFore(SCE_PAS_IDENTIFIER, clBlue);
  SetText('begin a+b; end');
end

This code correctly highlights identifiers and operators, but keywords have the same color as identifiers. It seems that SciLexer can't compare strings inside this library.

How to properly setup Scintilla keyword highlighting ?

Upvotes: 2

Views: 1457

Answers (1)

user1374768
user1374768

Reputation: 408

Keywords must be added manually.

SetKeyWords(0,'begin end');

Upvotes: 1

Related Questions