X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/d3209333839f29e4bfa7f34ba8dd38cbec154b9c..720eb2b9821a4147dbd124ff595e36fa2b9b45b2:/indent/python.vim?ds=sidebyside diff --git a/indent/python.vim b/indent/python.vim index 19b649e..347e60d 100644 --- a/indent/python.vim +++ b/indent/python.vim @@ -301,6 +301,13 @@ function! s:indent_like_previous_line(lnum) let empty = getline(a:lnum) =~# '^\s*$' + " Current and prev line are empty, next is not -> indent like next. + if empty && a:lnum > 1 && + \ (getline(a:lnum - 1) =~# '^\s*$') && + \ !(getline(a:lnum + 1) =~# '^\s*$') + return indent(a:lnum + 1) + endif + " If the previous statement was a stop-execution statement or a pass if getline(start) =~# s:stop_statement " Remove one level of indentation if the user hasn't already dedented