From baf89ad26488f6a7665d51b986f5c7ad2d22b30b Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 29 Jan 2022 21:03:49 -0500 Subject: [PATCH] Only reindent when enabled by Vim option References: https://github.com/tpope/vim-markdown/pull/187 --- plugin/surround.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/surround.vim b/plugin/surround.vim index 527dc3c..5d22ebd 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -360,8 +360,8 @@ function! s:insert(...) " {{{1 return "\" 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