[QScintilla] XML lexer and folding

Baz Walter bazwal at ftml.net
Tue May 6 19:47:21 BST 2008


Stefan Langer wrote:
> Hello,

Hello Stefan

> I just saw that statement about HTML-lexer can handle xml ... as far as
> i can see it can't correctly (tried even the latest snapshot from the
> website)
> ... I attached a screenshot that i took from the qt4-example (which I
> extended by a "textEdit->setLexer(new QsciLexerHTML(textEdit));")
> ... and one from SciTE, that shows xml the way i would like to see it in
> my qt-app

If you look in SciTE's default html.properties file, you'll see that a
different set of styles is used for XML. (The section dealing with this
starts around line 455).

> so ... what is wrong:
> - the QSci Lexer marks unknown Tags/Attributes red (but there is no
> unknown tags in xml ... it is_* *_*_EXTENSIBLE_ Markup Language* )

This problem can be solved by making the styles for *unknown*
Tags/Attributes the same as those used for *known* Tags/Attributes.

> - the QSci Lexer has no folding for xml
> 
> ... or is there any option in the HTML-Lexer to switch this behavior?
> (couldn't find something like that)

Folding can be switched on by setting the "fold.html" property to "1".

It would be nice if there was a qscintilla lexer to encapsulate a sane
set of defaults for XML. If you feel like making a contribution, it
would be pretty easy to write one (just take a look at qscilexerhtml.cpp
for inspiration).

Regards
Baz Walter



More information about the QScintilla mailing list