Hi!

Current python indentation has error. Check the following code
snippet:

if bool:
    do_stuff1()
else:
    do_stuff2(param1, param2,
              param3, param4)
do_stuff3()

If you try to format it with =ip you'd have 'do_stuff3()' indented to
'do_stuff2()' which is wrong.

if bool:
    do_stuff1()
else:
    do_stuff2(param1, param2,
              param3, param4)
    do_stuff3()


Fix. Starting from line 63 of indent/python.vim file change if block
from

  if parlnum > 0
    let plindent = indent(parlnum)
    let plnumstart = parlnum
  else
    let plindent = indent(plnum)
    let plnumstart = plnum
  endif


to


  if parlnum > 0
    " Do not indent 'do_stuff3()' if it's indent less than indent of
    " 'do_stuff2(...)':
    " if bool:
    "     do_stuff1()
    " else:
    "     do_stuff2(param1, param2,
    "               param3, param4)
    " do_stuff3()
    if indent(a:lnum) < indent(parlnum)
      return indent(a:lnum)
    else
      let plindent = indent(parlnum)
      let plnumstart = parlnum
    endif
  else
    let plindent = indent(plnum)
    let plnumstart = plnum
  endif


Maxim.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui