Vimjas / vim-python-pep8-indent

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

Handle jedi-vim call signatures when looking for colon in prev line #41

Closed blueyed closed 9 years ago

blueyed commented 9 years ago

This adds jedi\S to s:skip_special_chars and improves the algorithm to find the colon in the previous line in s:indent_like_previous_line.

There should be a test for this probably?! jedi-vim's syntax setup for the (partly concealed) call signature is at https://github.com/davidhalter/jedi-vim/blob/master/after/syntax/python.vim.

blueyed commented 9 years ago

@hynek I'd appreciate some quick feedback on this. I think it's good to be merged, and I'll do so after cleaning the commits up.

hynek commented 9 years ago

Could you elaborate a bit more what this does? Does it use jedi for certain tasks if it’s present?

blueyed commented 9 years ago

jedi-vim provides call signatures, via inserting text into the buffer and then uses concealing to hide parts of it. When you get such a call signature in a line after a colon, the colon at the end is currently not detected (because of the text that jedi-vim inserted). This PR will ignore this text.

I will refactor this to be used in more places, e.g. to also fix #32.

blueyed commented 9 years ago

Re-based and squashed.