fix case statement regex

This commit is contained in:
Jon Eskin 2022-06-09 04:54:50 -04:00
parent 318fb02bb9
commit 2b051dd25a

View File

@ -98,8 +98,8 @@ provide-module hare %§
try %[ execute-keys -draft k<a-x> <a-k> [{(]\h*$ <ret> j i<tab> ] try %[ execute-keys -draft k<a-x> <a-k> [{(]\h*$ <ret> j i<tab> ]
# cleanup trailing white spaces on the previous line # cleanup trailing white spaces on the previous line
execute-keys -draft k :hare-trim-indent <ret> execute-keys -draft k :hare-trim-indent <ret>
# indent after a switch's case/default statements # indent after match/switch's case statements
try %[ execute-keys -draft k<a-x> <a-k> ^\h*(case|default).*:$ <ret> j<a-gt> ] try %[ execute-keys -draft k<a-x> <a-k> case\h.*=>\h*$ <ret> j<a-gt> ]
# deindent closing brace(s) when after cursor # deindent closing brace(s) when after cursor
try %[ execute-keys -draft <a-x> <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> ] try %[ execute-keys -draft <a-x> <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> ]
} } } }