[Kbabel] highlighting - first draft

Marco Wegner dubbleu@web.de
Mon, 25 Nov 2002 21:46:52 +0100


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 25 November 2002 17:02, Stanislav Visnovsky wrote:
> Hi!
>
> I've tested your code and it works really nicely. The only problem is that
> if there is an error, it does not change the color to the error color.
> But that could be just a problem with my current tree (it is heavily
> modifed already, but the patch applied almost cleanly).

This is *not* a problem of your tree but a general one :-( 
I've only been testing complete files to see if my regular expressions work 
fine that I completely forgot about the errors (here only the dots are 
displayed in red :-) 

But this shouldn't be too hard to fix. I think I'll include a slot, something 
like hasErrors( bool ). When true then the normal text will be displayed with 
error color otherwise with text color.

> This would be nice to have for the next KBabel version.

Sure. As a side effect it also removes several of the compiler warnings about 
comparison of signed and unsigned int :-)

> The question about configuration: I'd like to keep the current interface
> of MsgMultiLine, at least at the moment. I'm wondering if we need to
> implement a central configuration singleton or something, just to keep the
> configuration-related code reasonable (it starts to spread all over the
> map).

You mean with the colors? I was only talking about reading the colors from the 
config. Right now I'm defining default colors in KBabelHighlighter's 
constructor. This wouldn't be necessary anymore if I read the colors from the 
config file (or MsgMultiLineEdit reads the colors and passes them on...)

> KBabel already stores some of its regular expressions in the kbabelrc
> config file (for example tag-matching regexps).
>
> As to bold text, I'm not really sure about this: did you try it? I would
> expect some problems with "dots".

No, I haven't. I only know that I like the look of the highlighting as it is 
done in Kate. Therefore I thought I could try something like that... I'll 
give it a try and then we'll see.

Marco

- -- 
Marco Wegner <mail@marcowegner.de>, <dubbleu@web.de>
Contributing to KBabel http://i18n.kde.org/tools/kbabel 
   and kde-i18n-de http://i18n.kde.org/teams/de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE94oxFX3rotM03gSgRAkWQAJ4rZ4YptDO4au0Sw3qtWEFCRzg7FwCgoByX
ncOd+buMfXMRagZSUV3r3aM=
=uFLz
-----END PGP SIGNATURE-----