Created
May 25, 2014 16:33
-
-
Save flaviut/f19686c0b477ccd9bab4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* kate-script | |
* name: Nimrod | |
* author: Flaviu Tamas <tamas.flaviu@gmail.com> | |
* license: BSD | |
* revision: 1 | |
* kate-version: 3.13 | |
* indent-languages: nimrod | |
*/ | |
require("cursor.js") | |
require("range.js") | |
require("document.js") | |
function indent(line, indentWidth, ch) { | |
/** | |
* line: the line number that has to be indented | |
* indentWidth: the indentation width in number of spaces | |
* ch: either a newline character (ch == '\n'), the trigger character | |
* specified in triggerCharacters or empty if the user invoked the action | |
* Tools → Align. | |
*/ | |
if(ch == '\n'){ | |
if(document.endsWith(line-1, "=", skipWhiteSpaces=true)){ | |
return indentWidth; | |
} | |
} | |
return -2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment