Vimjas / vim-python-pep8-indent

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

Intermediate fix for indenting huge dicts #91

Closed blueyed closed 6 years ago

blueyed commented 7 years ago

This uses different offsets for the type of pairs: '()' and '[]' will only look for just 20 lines above, while 1000 lines are used for '{}', which might be a huge dict.

Ref: https://github.com/Vimjas/vim-python-pep8-indent/pull/64.

mgedmin commented 7 years ago

FWIW I've had some list literals longer than 20 lines. For example: https://github.com/ManoSeimas/manoseimas.lt/blob/master/manoseimas/scrapy/tests/test_suggestions.py#L770-L806

blueyed commented 7 years ago

@mgedmin Ok, let's use 100 then for [].

I have some ideas to improve upon this (by doing a quick lookup first and using caching), but this should be good as is for an indermediate fix then.

mgedmin commented 6 years ago

Just had to indent another 80-line list literal. This PR worked fine.