Skip to content

indenting long lists fails because of maxoff #63

Open

Description

@temaput

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?

Activity

  1. blueyed commented on Feb 22, 2017

    @blueyed
    Member

    #64 has a fix/config option.

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

  2. temaput commented on Feb 23, 2017

    @temaput
    Author

    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...

  3. mgedmin commented on Aug 30, 2017

    @mgedmin

    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.)

  4. blueyed commented on Dec 22, 2018

    @blueyed
    Member

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

  5. Kache commented on Oct 29, 2024

    @Kache

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions