[RkWard-devel] Context sensitive history

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Sun Jan 14 22:34:14 UTC 2007


Hi Roland,

since I was the one who screwed up the Reply-To: Header, I guess this was 
probably meant to go the mailing list as well, and I'm CCing it there. Hope 
that's ok with you.

On Sunday 14 January 2007 20:19, you wrote:
> it works nicely, although I personally would prefer the Shift (or whatever
> else) modifier conected to the context insensitive history. Ok, that's a
> matter of taste, thus configurabilty would be great.

Implemented. Time to add help pages to the settings, though, as I'm afraid the 
option label is rather cryptic to anyone who has not read this thread...

> Another "enhacement idea" that came to my mind last week regards the script
> editor. I think it would be cool to be able to run the current block (block
> in terms of the code folding brackets). Usually I have a couple of function
> assignments in the script editor and would like to run either of them
> seperately without selecting it before. The blocks to run are given by the
> toplevel code folding nodes. So do you think one could by any means access
> KateCodeFoldingTree *foldingTree() in the KateDocument class to implement
> such a feature. As far as I understand the kdelibs-API one can only access
> the Kate::Document interface which does not provide the necessary  methods.
> Maybe you've got an idea about that.

Nice idea. But in fact, I can see no elegant way to do it right now. Probably 
we'd have to do a simplified parse from the start of the document, counting 
the number of opening curly braces minus closing open braces up to the cursor 
(being careful to exclude comments and strings), remembering the position of 
the last top-level opening brache encountered. Then count down closing curly 
braces after the cursor to determine the end of the statement. Finally 
determine the start of the expression the opening curly brace belongs to (not 
quite trivial, as this may be inside a function call such as for "try 
({expr})", or eben a nested function call, and on a different line 
altogether). Possible, but not exactly a simple thing to add.

Supposedly in KDE4 we will gain access to the parse tree of the syntax 
highlighting machine 
(http://developer.kde.org/documentation/library/cvs-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1SmartInterface.html ; 
but I have not looked at it in detail, so far). Then implementing this 
feature (and some other nice things) will be a lot easier. So I think I'll 
rather delay this. But if you'd like to scratch that itch, I'd be more than 
happy to accept a patch...

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070114/620e8a4e/attachment.sig>


More information about the Rkward-devel mailing list