]>
git.madduck.net Git - etc/vim.git/blobdiff - indent/python.vim
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
let s:maxoff = 50
let s:block_rules = {
let s:maxoff = 50
let s:block_rules = {
- \ '^\s*\(elif\|else\)\>': ['if', 'elif'],
+ \ '^\s*elif\>': ['if', 'elif'],
+ \ '^\s*else\>': ['if', 'elif', 'for', 'try', 'except'],
\ '^\s*except\>': ['try', 'except'],
\ '^\s*finally\>': ['try', 'except', 'else']
\ }
\ '^\s*except\>': ['try', 'except'],
\ '^\s*finally\>': ['try', 'except', 'else']
\ }
call filter(positions, 'v:val[0]')
call sort(positions, 's:pair_sort')
call filter(positions, 'v:val[0]')
call sort(positions, 's:pair_sort')
- return get(positions, 0 , [0, 0])
+ return get(positions, -1 , [0, 0])
endfunction
" Find the start of a multi-line statement
endfunction
" Find the start of a multi-line statement
if nothing_after_opening_paren
if starts_with_closing_paren
if nothing_after_opening_paren
if starts_with_closing_paren
+ let res = base + s:sw()
endif
else
" Indent to match position of opening paren.
endif
else
" Indent to match position of opening paren.
+ let res = paren_col
+ endif
+
+ " If this line is the continuation of a control statement
+ " indent further to distinguish the continuation line
+ " from the next logical line.
+ if text =~# s:control_statement && res == base + s:sw()
+ return base + s:sw() * 2
+ else
+ return res