Skip to content

Commit

Permalink
Only reindent when enabled by Vim option
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Jan 30, 2022
1 parent aeb9332 commit baf89ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/surround.vim
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ function! s:insert(...) " {{{1
return "\<Del>"
endfunction " }}}1

function! s:reindent() " {{{1
if exists("b:surround_indent") ? b:surround_indent : (!exists("g:surround_indent") || g:surround_indent)
function! s:reindent() abort " {{{1
if get(b:, 'surround_indent', get(g:, 'surround_indent', 1)) && (!empty(&equalprg) || !empty(&indentexpr) || &cindent || &smartindent || &lisp)
silent norm! '[=']
endif
endfunction " }}}1
Expand Down

0 comments on commit baf89ad

Please sign in to comment.