[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: tests/katetests/regression/tests/indent
From:       Leo Savernik <l.savernik () aon ! at>
Date:       2007-07-31 16:36:03
Message-ID: 200707311836.03968.l.savernik () aon ! at
[Download RAW message or body]

Am Montag, 30. Juli 2007 schrieb Dominik Haumann:
> On Sunday 22 July 2007, Leo Savernik wrote:
[...]
> > Is it now possible to get the correct style of the newly inserted
> > character, too?
>
> No, a newly inserted character is not highlighted yet. 
[...]

> > The old indenter lacked attribute information for the
> > newly inserted character (i. e. it was always of type "normal"), making
> > some very awkward workarounds necessary like for: case ':':
> >
> > Let's say, the preexisting text is
> >
> > case '|
> >
> > (| denotes the position of the caret), and the user enters ":", we get
> >
> > case -':|
> >
> > but the ":" is not yet resolved to be of type "character" as of Katepart
> > 2.5.7. Can we have this sort of information in KDE 4 now?
>
> Unfortunately not, reason is the reference counting of editBegin and
> editEnd in KateDocument. editBegin and editEnd group actions together to
> only one undo-action.
>
> ...in theory, something like would work:
>
> editBegin();
>   // insert/remove text
> editEnd();
> editBegin();
>   // call indenter functions
> editEnd();
>
> But then undo would be 2 steps (maybe it's even errorprone, as there might
> be additional editBegin/editEnds wrapped around it).

That means only the outermost editBegin/editEnd pair actually triggers actual 
hl recalculation?

Isn't there some means to force hl recalculation for just one character? I 
don't know the inner workings of hl but I assume it wouldn't be too slow.

>
> But I agree: for Indentation, it would be a nice thing to have (*)
>
> (*) In your example, this would not solve the problem, though, because the
> HlCString rule matches only if the expression is complete, i.e. »'a'« is
> complete, but »'a« is not (you can even see that if you test it :) )

D'oh, right you are :-). Well, that could be fixed in the hl-file.

mfg
	Leo
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic