X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/d2e98dbde5ea28dbc87e5d14092a47f0e886898e..222fbda19d59ba0124aedade5a3ee4a10fb90a93:/indent/python.vim?ds=sidebyside diff --git a/indent/python.vim b/indent/python.vim index 8a479f4..b3a5141 100644 --- a/indent/python.vim +++ b/indent/python.vim @@ -303,17 +303,19 @@ function! s:indent_like_previous_line(lnum) return base + s:sw() endif + let empty = getline(a:lnum) =~# '^\s*$' + " 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 - if indent(a:lnum) > base - s:sw() + if empty || current > base - s:sw() return base - s:sw() endif " Otherwise, trust the user return -1 endif - if s:is_dedented_already(current, base) + if !empty && s:is_dedented_already(current, base) return -1 endif