Vimjas / vim-python-pep8-indent

A nicer Python indentation style for vim.
Creative Commons Zero v1.0 Universal
790 stars 69 forks source link

Handling indent when auto-complete parenthesis #6

Closed ethinx closed 11 years ago

ethinx commented 11 years ago

Just try this plugin and find the plugin can't handle the indent well when auto-complete parenthesis.

Description:

I input a = () and the parenthesis is auto-complete, then press Enter, the there will not be indent in the following line:

a = (
*)

Expect result:

a = (
    *)

* means the cursor position.

hynek commented 11 years ago

That seems to be rather an issue of the auto-complete plugin? If I write a = () myself and press enter between the parentheses I’ll get:

a = (
*)

Therefore there must be more going on?

soli commented 11 years ago

I have tried with smartinput, and the behavior is the one the OP expects, not the one the OP sees:

a = (
    *
)
ethinx commented 11 years ago

Sorry, revise the expect result, just my opinion and I think it would be a better and lazy way :(

a = (*)
a = (
    *)
a = (
    'apple',
    'pear',*)
a = (
    'apple',
    'pear',
    *)
a = (
    'apple',
    'pear',
)
*

* means the cursor position.

soli commented 11 years ago

Well, indeed this behavior is definitely not the job of pep8-indent but that of your autocomplete plugin… some probably can be tuned to do what you want.

ethinx commented 11 years ago

OK, Thanks all the way :+1: