Skip to content

Instantly share code, notes, and snippets.

@flaviut
Created May 25, 2014 16:33
Show Gist options
  • Save flaviut/f19686c0b477ccd9bab4 to your computer and use it in GitHub Desktop.
Save flaviut/f19686c0b477ccd9bab4 to your computer and use it in GitHub Desktop.
/* 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