File indexing completed on 2024-05-05 03:58:10
0001 /* kate-script 0002 * name: Indenter name (appears in the menu) 0003 * license: license (BSD, GPL, LGPL, Artistic, etc) 0004 * author: first name last name <email-address> 0005 * revision: 1 (simple integer number) 0006 * kate-version: 3.4 0007 */ 0008 0009 // specifies the characters which should trigger indent, beside the default '\n' 0010 triggerCharacters = "{}/:;"; 0011 0012 /** 0013 * Indent a line. 0014 * This function is called for every <return/enter> and for all trigger 0015 * characters. ch is the character typed by the user. ch is 0016 * - '\n' for newlines 0017 * - "" empty for the action "Tools > Align" 0018 * - all other characters are really typed by the user. 0019 * 0020 * Return value: 0021 * - return -2; - do nothing 0022 * - return -1; - keep indentation (searches for previous non-blank line) 0023 * - return 0; - All numbers >= 0 are the indent-width in spaces 0024 * 0025 * Alternatively, an array of two elements can be returned: 0026 * return [ indent, align ]; 0027 * 0028 * The first element is the indent-width like above, with the same meaning 0029 * of the special values. 0030 * 0031 * The second element is an absolute value representing a column for 0032 * "alignment". If this value is higher than the indent value, the 0033 * difference represents a number of spaces to be added after the indent. 0034 * Otherwise, it's ignored. 0035 * 0036 * Example: 0037 * Assume using tabs to indent, and tab width is 4. Here ">" represents a 0038 * tab, and "." represents a space: 0039 * 1: > > foobar("hello", 0040 * 2: > > ......."world") 0041 * 0042 * When indenting line 2, the script returns [8, 15]. Two tabs are inserted 0043 * to indent to column 8, and 7 spaces are added to align the second 0044 * parameter under the first, so that it stays aligned if the file is viewed 0045 * with a different tab width. 0046 */ 0047 function indent(line, indentWidth, ch) 0048 { 0049 return -2; 0050 } 0051 0052 // kate: space-indent on; indent-width 4; replace-tabs on;