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

List:       kwrite-devel
Subject:    Re: Indentation Scripting
From:       Dominik Haumann <dhdev () gmx ! de>
Date:       2007-07-18 14:22:28
Message-ID: 200707181622.28872.dhdev () gmx ! de
[Download RAW message or body]

On Wednesday 18 July 2007, Sebastian Pipping wrote:
> Dominik Haumann wrote:
> > Just for info:
> > http://dhaumann.blogspot.com/2007/07/kate-scripting-indentation.html
> >
> > Maybe we can get some contributors.
>
> ----------------------------------------------------
> I think you need to give one or two concrete
> usage examples. From that blog post I am
> still not fully sure what such a script will do.
> Is it like I hit return and the script indents
> the next line one step more than the previous
> line? Does it do something like that? What other
> use is possible?

The script itself does nothing useful: it simply tells Kate Part to indent 
the current line like the previous.
It's meant to be a template instead of a useful script ;)

Example:
function indent(line, indentWidth, typedChar)
{
    if (typedChar == ':') {
        // check for 'case' string
        // if found, search upwards for a switch statement and get the
        // indentation depth of this line. call it n.
        // and now return n, that means Kate Part will align the
        // case statement with the same depth as switch...
        return n;
    }
    return -1;
}

Just a stupid example, and probably not how it should be implemented.
Maybe I should blog again to provide concrete examples :)

Dominik
_______________________________________________
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