hare.vim

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

commit d15cbd00575bc517dfd54d1d27a4de18223e3a9c
parent bae3a9c565c18d80ebcd92372dde4aa28dd0d80d
Author: Sebastian <sebastian@sebsite.pw>
Date:   Tue, 22 Feb 2022 18:47:03 -0500

Get autoindent from previous line

s/indent(v:lnum)/indent(prevlnum)/

Among other things, this makes `S` re-indent the current line.

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

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

diff --git a/indent/hare.vim b/indent/hare.vim @@ -67,7 +67,7 @@ function! GetHareIndent() if line =~# '\v^\s*case' " If the previous line was also a case, don't do any special indenting. if prevline =~# '\v^\s*case' - return indent(v:lnum) + return indent(prevlnum) end " If the previous line started a block, deindent by one shiftwidth. @@ -98,7 +98,7 @@ function! GetHareIndent() " If the previous line ended in a semicolon and the line before that was a " case, don't do any special indenting. if prevline =~# '\v;\s*(//.*)?$' && prevprevline =~# '\v\=\>\s*(//.*)?$' - return indent(v:lnum) + return indent(prevlnum) endif " If everything above is false, do a normal cindent.