Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indenting long lists fails because of maxoff #63

Open
temaput opened this issue Nov 3, 2016 · 5 comments
Open

indenting long lists fails because of maxoff #63

temaput opened this issue Nov 3, 2016 · 5 comments

Comments

@temaput
Copy link

temaput commented Nov 3, 2016

Hi!
I found out that current version of find_opening_paren looks for only as long as 50 lines backwards for opening parenthesis. This is set explicitly by maxoff variable and prevents any list longer than 50 lines from being indented correctly. Is it a bug, or is it somehow a feature?

@blueyed
Copy link
Member

blueyed commented Feb 22, 2017

#64 has a fix/config option.

@temaput
What would you set it to? Please provide your feedback over there.

@temaput
Copy link
Author

temaput commented Feb 23, 2017

Personaly I removed it completely on my machine (the stopline arg from searchpairs to be precise). Maybe I am not used to dealing with really long files, but I am not experiencing any lags without maxoff at all. So I think maybe to make it optional, or make it turning on only in long files, like YouCompleteMe does...

@mgedmin
Copy link

mgedmin commented Aug 30, 2017

How about double the default value every time someone files a bug complaining about this? Undo the last doubling if somebody complains about indentation being noticeably slow. Should converge to a reasonable default value after a few iterations.

(I'm reading this issue because I also have list literals in my unit tests that are longer than 50 lines. In this particular project they're shorter than 100 lines. I've now set g:python_pep8_indent_max_back_search to 1000 in my .vimrc and will see if I can perceive any slowdown.)

@blueyed
Copy link
Member

blueyed commented Dec 22, 2018

Defaults have been adjusted by now.
How does it work for you?

@Kache
Copy link

Kache commented Oct 29, 2024

In case anyone else runs into this (since it's not yet mentioned here), the current workaround from #91 is configured at:

" Pairs to look for when searching for opening parenthesis.
" The value is the maximum offset in lines.
let s:paren_pairs = {'()': 50, '[]': 100, '{}': 1000}

Looks like maintainers want to keep it private and keep the freedom to change it in the future

In the meantime, I've set my own to:

let s:paren_pairs = {'()': 9999, '[]': 9999, '{}': 9999}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants