On Mon, 24 Jul 2006 14:36:20 +1100
"Alexander Klenin" <[EMAIL PROTECTED]> wrote:
> On 7/23/06, Mattias Gaertner <[EMAIL PROTECTED]> wrote:
> > > I have recently started poking around it and have some ideas ;-)
> >
> > What ideas?
> Well, for starters, the code obviously will benefit from some refactoring.
> E.g. "mouse links" processing is spread over many different places,
> with some literally duplicating code.
ok
> The interface of syntax highlighters needs improvement also.
> I tried to disable "mouselinks" over keywords and numbers (because
> clicking them will always lead to error). I have found the following:
> one the one hand, "IsKeyword" function defined in basic class is not
> implemented in descendants,
> on the other hand, "GetToken" function, seemingly designed to return
> the type of the current token, returns unadorned integer, with no way
> to interpret it, and GetTokenID function, which does return enumerated
> type, is pascal-specific.
> Is the above worth fixing?
Sure.
GetToken: it *is* an unadorned PtrInt. Only the highlighter knows, what it
means. With codefolding it can be a pointer.
I see two ways to find out if a word is an identifier:
a) Let the highlighter parse the line to the word under cursor and add a
function to highlighter 'IsIdentifier'. Disadvantage: It will still
highlight words of non pascal.
b) add an event to synedit OnWordHasLink(Sender,Line,Col): boolean. The IDE
can then examine the word and it knows better what can be used as link and
what not.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives