Skip to content

Commit

Permalink
Alter c-like line adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
andymass committed Mar 5, 2019
1 parent 9d8c684 commit 61e4b7a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions autoload/matchup/quirks.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ let s:clikeft = [ 'arduino', 'c', 'cpp', 'cuda',

" }}}1

let s:adjust_max = 5
let s:adjust_max = 7

function! matchup#quirks#status_adjust(offscreen) abort " {{{1
if a:offscreen.match ==# '{' && matchup#quirks#isclike()
\ && strpart(getline(a:offscreen.lnum),
\ 0, a:offscreen.cnum-1) =~# '^\s*$'
" go up to next line with same indent (up to 5)
" go up to next line with same indent (up to s:adjust_max)
for l:adjust in range(-1, -s:adjust_max, -1)
if indent(a:offscreen.lnum + l:adjust) == indent(a:offscreen.lnum)
break
return l:adjust
endif
endfor
return l:adjust
endif

return 0
Expand Down

0 comments on commit 61e4b7a

Please sign in to comment.