1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 11:50:51 -08:00
emacs/test/lisp/progmodes/c-ts-mode-resources
Yuan Fu afbce8bb46
Improve tree-sitter indent anchor prev-adaptive-prefix (bug#61314)
Now prev-adaptive-prefix looks at the current line and checks if it
begins with a prefix itself.  If it does, prev-adaptive-prefix tries
to place the anchor before the prefix on the previous line, rather
than after it.

 - prev line
 - this line -> This line starts with a "-", i.e., begins with a
                prefix, so we place the anchor at the beginning of the
                 "-" of the previous line, rather than after it

 - prev line
   this line -> This line doesn't start with a prefix, so the anchor
                is placed after the previous line's "-".

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el:
(treesit-simple-indent-presets): Add local variable
this-line-has-prefix, base what anchor to return on the value of
this-line-has-prefix and whether the prev line has a prefix.
2023-02-19 12:34:19 -08:00
..
filling.erts
indent-bsd.erts Make c-ts-mode-set-style's effect local (bug#61245) 2023-02-04 15:33:26 -08:00
indent-preproc.erts Cleanup preproc indent for c-ts-mode (bug#61558) 2023-02-19 20:47:05 +01:00
indent.erts Improve tree-sitter indent anchor prev-adaptive-prefix (bug#61314) 2023-02-19 12:34:19 -08:00