pub fn is_electric_trigger(lang: Lang, line_head: &str, typed: char) -> boolExpand description
Whether typing typed at the end of line_head should re-indent
the current line.
Two triggers, matching the two ways a language closes a block:
typedis a bracket closer and nothing but whitespace precedes it on the line. The “nothing but whitespace” part matters — a}at the end oflet x = Foo { a };must not re-indent the line.line_head + typedcompletes a dedent keyword that begins the line. Checked as a whole word soendfires butappendanddefendersdo not.