Neil,
After carefully inspecting the ColouriseTeXDoc code I realized that the
keywordlists are not used most of the time because most TeX files would not
begin with a comment line like "%interface=tex" or "interface=latex" and the
like. Besides in SciTE, it is nonsense to begin a TeX document with such a
strange comment line and it is better to colourise TeX document according to
command styles defined by the character "\" and by tags like \begin{} ...
\end{}, $$...$$, $...$ etc. In some cases (e.g. for users using UTF8 encoding),
the first line of the document must be used for other purposes (e.g. putting %#
-*- coding: utf-8 -*- there in order that SciTE recognize the document as being
written in UTF8 encoding) and so it is basically impossible to specify the TeX
interface by putting in the first line some commented instruction as mentioned
above. Moreover, since the TeX language is highly customizable, users can and
frequently do define new commands and structures, so the mechanism for
colourising TeX documents according to keywordlists is highly un-reliable. To
this end I found the colourising code in LexOthers.cxx for LaTeX is better
implemented which does not depend on any keywordlists and it provides a way for
assigning different colors to inline and standalong maths and to the
\begin{}...\end{} tags themselves. So I'm wondering if you would accept the
idea of replacing ColouriseTeXDoc code in LexTeX.cxx with something similar to
ColoriseLaTeXDoc from LexOthers.cxx.
If the above change is acceptable, then the problem of reading user defined
header keywords from LexTeX is easily solved: one can just use keywords.tex to
keywords9.tex to specify custom header types without interfering with the
ColouriseTeXDoc procedure. There is no extra cost here and the change described
above just makes the colourising for TeX documents work better.
If you would agree with the above idea, I will send you a new implementation of
LexTeX (or LexOthers) which realizes better folding for TeX documents (with
Cascade and Plain modes and user defined header types). Even if no change to
ColouriseTeXDoc is to be made, the new code works just as well, but in that
case no %interface=... line should appear on the first line of the document.
Regards
instanton
2007-06-29
----- Original Message -----
From: Neil Hodgson
To: Discussion of the Scintilla editing component
Sent: 2007-06-26, 11:49:06
Subject: Re: Re: [scintilla] styler.GetPropertyInt and keywordlists
instanton:
> Yes this is the structure I am having in mind. But then how would Scintilla
> read this setting? Searching in the whole Scintilla source tree I got only
> "styler.GerPropertyInt", and I don't know how would Scintilla get
> non-integer properties from the property files.
Its probably a little too expensive to be calling
styler.GetProperties here so something that exposes the Get method of
the props object held inside the Accessor. Returning an SString over a
(potential) language barrier is also problematic so there may need to
be a way to return a const char * instead.
Neil
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest