]>
git.madduck.net Git - etc/vim.git/commitdiff
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:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c1bd583 )
- " If the line starts with 'except', or 'finally', line up with 'try'
- " or 'except'.
- if thisline =~ '^\s*\(except\|finally\)\>'
+ " If the line starts with 'except' line up with 'try' or 'except'.
+ if thisline =~ '^\s*except\>'
let bslnum = s:BlockStarter(a:lnum, '^\s*\(try\|except\)\>')
if bslnum > 0
return indent(bslnum)
let bslnum = s:BlockStarter(a:lnum, '^\s*\(try\|except\)\>')
if bslnum > 0
return indent(bslnum)
+ " If the line starts with 'finally', line up with 'try', 'else', or
+ " 'except'.
+ if thisline =~ '^\s*finally\>'
+ let bslnum = s:BlockStarter(a:lnum, '^\s*\(try\|except\|else\)\>')
+ if bslnum > 0
+ return indent(bslnum)
+ else
+ return -1
+ endif
+ endif
+
" If the line starts with 'else', line it up with 'try', 'except', 'for',
" 'if', or 'elif'.
if thisline =~ '^\s*else\>'
" If the line starts with 'else', line it up with 'try', 'except', 'for',
" 'if', or 'elif'.
if thisline =~ '^\s*else\>'
+ describe "when an 'else' is followed by" do
+ before { vim.feedkeys 'i\<TAB>\<TAB>else:\<CR>XXX\<CR>' }
+ it "a 'finally', it lines up with the 'else'" do
+ vim.feedkeys 'finally:'
+ indent.should == shiftwidth * 2
+ end
+ end
+
+
describe "when a 'try' is followed by" do
before { vim.feedkeys 'i\<TAB>\<TAB>try:\<CR>' }
it "an 'except', it lines up with the 'try'" do
describe "when a 'try' is followed by" do
before { vim.feedkeys 'i\<TAB>\<TAB>try:\<CR>' }
it "an 'except', it lines up with the 'try'" do