1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 11:00:45 -08:00
emacs/test/lisp/progmodes/sh-script-resources/sh-indents.erts
Mauro Aranda ad02fc212b Fix indentation and fontification in shell-script (Bug#26217)
* lisp/progmodes/sh-script.el (sh-smie--sh-keyword-p): Treat "do" as
special, like we treat "in".
(sh-smie--sh-keyword-in-p): Change signature.  Take the token to
decide correctly if it's a keyword.
(sh-font-lock-keywords-var-1): Add do.

* test/lisp/progmodes/sh-script-resources/sh-indents.erts: New test.
* test/lisp/progmodes/sh-script-tests.el
(sh-script-test-do-fontification): New test.
2023-10-14 11:00:15 -04:00

47 lines
431 B
Text

Code:
(lambda ()
(shell-script-mode)
(indent-region (point-min) (point-max)))
Name: sh-indents1
=-=
if test;then
something
fi
other
=-=-=
Name: sh-indents2
=-=
if test; then
something
fi
other
=-=-=
Name: sh-indents3
=-=
if test ; then
something
fi
other
=-=-=
Name: sh-indents4
=-=
if test ;then
something
fi
other
=-=-=
Name: sh-indents5
=-=
for i do echo 1; done
for i; do echo 1; done
=-=-=