Variable: treesit-simple-indent-standalone-predicate
treesit-simple-indent-standalone-predicate is a variable defined in
treesit.el.gz.
Value
nil
Documentation
Function used to determine if a node is "standalone".
"Standalone" means the node starts on a new line. For example, if we
look at the opening bracket, then it's standalone in this case:
{ <-- Standalone.
return 1;
}
but not in this case:
if (true) { <-- Not standalone.
return 1;
}
The value of this variable affects the standalone-parent indent preset
for treesit-simple-indent. If the value is nil, the standalone condition
is as described. Some major mode might want to relax the condition a
little bit, so that it ignores some punctuation like ".". For
example, a Javascript mode might want to consider the method call below
to be standalone too:
obj
.method(() => { <-- Consider ".method" to be standalone,
return 1; <-- so this line anchors on ".method".
});
The value should be a function that takes a node, and return t if it's standalone. If the function returns a position, that position is used as the anchor.
Source Code
;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(defvar treesit-simple-indent-standalone-predicate nil
"Function used to determine if a node is \"standalone\".
\"Standalone\" means the node starts on a new line. For example, if we
look at the opening bracket, then it's standalone in this case:
{ <-- Standalone.
return 1;
}
but not in this case:
if (true) { <-- Not standalone.
return 1;
}
The value of this variable affects the `standalone-parent' indent preset
for treesit-simple-indent. If the value is nil, the standalone condition
is as described. Some major mode might want to relax the condition a
little bit, so that it ignores some punctuation like \".\". For
example, a Javascript mode might want to consider the method call below
to be standalone too:
obj
.method(() => { <-- Consider \".method\" to be standalone,
return 1; <-- so this line anchors on \".method\".
});
The value should be a function that takes a node, and return t if it's
standalone. If the function returns a position, that position is used
as the anchor.")