From: Hynek Schlawack Date: Sun, 3 Jul 2016 11:19:59 +0000 (+0200) Subject: Merge pull request #54 from blueyed/fix-typo X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/e1d10d7245ae11cea9fec2fd5a43757df6114691?hp=7e143ab37a8cac78278615789ce22f0a81cd424c Merge pull request #54 from blueyed/fix-typo Doc fixes --- diff --git a/indent/python.vim b/indent/python.vim index 4306985..5c701e4 100644 --- a/indent/python.vim +++ b/indent/python.vim @@ -281,10 +281,7 @@ function! s:indent_like_previous_line(lnum) return -1 endif - " If this line is dedented and the number of indent spaces is valid - " (multiple of the indentation size), trust the user - let dedent_size = current - base - if dedent_size < 0 && current % s:sw() == 0 + if s:is_dedented_already(current, base) return -1 endif @@ -292,6 +289,13 @@ function! s:indent_like_previous_line(lnum) return base endfunction +" If this line is dedented and the number of indent spaces is valid +" (multiple of the indentation size), trust the user. +function! s:is_dedented_already(current, base) + let dedent_size = a:current - a:base + return (dedent_size < 0 && a:current % s:sw() == 0) ? 1 : 0 +endfunction + " Is the syntax at lnum (and optionally cnum) a python string? function! s:is_python_string(lnum, ...) let line = getline(a:lnum)