hare.vim

[vim] Hare vim plugin
git clone https://git.torresjrjr.com/hare.vim.git
Log | Files | Refs | README | LICENSE

commit 22e2b66129c6c65025274159dc975d3ca865d57b
parent 143767535988f1e77ae2090be7812dcc39690dca
Author: Sebastian <sebastian@sebsite.pw>
Date:   Fri, 15 Apr 2022 18:53:58 -0400

Correctly indent multiline cases

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mindent/hare.vim | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/indent/hare.vim b/indent/hare.vim @@ -104,6 +104,11 @@ function! GetHareIndent() return l:indent endif + " Don't indent an extra shiftwidth for cases which span multiple lines. + if prevline =~# '\v\=\>\s*(//.*)?$' && prevline !~# '\v^\s*case\W' + return indent(prevlnum) + endif + " Indent the body of a case. " If the previous line ended in a semicolon and the line before that was a " case, don't do any special indenting.