New indentation code in KDevelop 2
August Hörandl
august.hoerandl at gmx.at
Sun Dec 9 11:25:04 UTC 2001
"Eray Ozkural (exa)" wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Saturday 08 December 2001 18:51, August Hörandl wrote:
> > i don't think gnuclient ist the right thing, it uses xemacs in another
> > window
> >
> > mybe it should be more like http://www.cs.indiana.edu/elisp/gui-xemacs/
> >
> > ...
> >
>
> Uh, I didn't know about that. Hmm, that's the xemacs-gtk that we all tried. :)
>
> But that's GTK, we can't possibly use it, it wouldn't look good and it would
> bring too much bloat/dependencies.
but it seems that they seperated the code from the user interface, wihch
makes a port much easier
long ago there were plans for a kemacs, but the where troubles and the
emacs code wasn't compatible with the no-gpl qt, but this should be no
problem now
> Porting that to Qt/KDE is way too much work for me but let this post be a
> reminder for all those interested ;)
maybe i should post an urgent wish on the buglist
> Ah, okay I get your point. I thought you would like the parser to indent it to
> {
> int x;
> code;
>
> which would require an incremental parser. (That's a nice design experiment
> for you kdevelop fans out there!)
>
> To do that I ought t' be checking firstChar() as well as lastChar() for
> opening brace.
just a hint - what i did in my chill indent code:
- indentation is always based on the previos line(s)
- move back to beginning of the previos instruction (which would be
easy in c: just look for { or ;
- get the indent of this line
- from here to the beginning of the current line calculate the new value
+ some tokens increment: {
+ some decrement: }
+ additional value if the last token is not ending an
instruction(continue line) ; }
either just one level in or line up under the last nonclosed ( or =
and there are the case labels and the public, private aso. ...
Gustl
--
August Hörandl
august.hoerandl at gmx.at Linux - Life is too short for reboots
More information about the KDevelop-devel
mailing list