X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/d3209333839f29e4bfa7f34ba8dd38cbec154b9c..e1b71a2f196d566a81c85d1bce02acb8d252086c:/indent/python.vim 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