tags:

views:

48

answers:

1

Consider the following block of code-

if (1==1):#Go forever
    print "Wooo."

Vim doesn't see the :, due to the comment, so it insists that the print should be at the same indent level as the "if"

using http://www.vim.org/scripts/script.php?script_id=974

Any thoughts would be appreciated.

+1  A: 

Find this in the .vim file:

" If the previous line ended with a colon, indent relative to
" statement start.
if pline =~ ':\s*$'

change it to...

" If the previous line ended with a colon, indent relative to
" statement start.
if pline =~ ':\s*\(#.*\)\?$'

That will make it also match lines that end with a colon followed by a comment.

Amber
just a bit faster than me :)
akira
Vim needs a few more backslashes: `if pline =~ ':\s*\%(#.*\\)\?$'`
too much php
@too much php: fix't
Amber