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

Add a user configuration for the maxoff length #64

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ With content already, it will be aligned to the opening parenthesis::

Existing indentation (including ``0``) in multiline strings will be kept, so this setting only applies to the indentation of new/empty lines.

python_pep8_indent_max_back_search
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you have an error re-indenting a large list or dict set ``g:python_pep8_indent_max_back_search`` to a larger number.
This defaults to ``50``


Notes
-----
Expand Down
6 changes: 5 additions & 1 deletion indent/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ if !exists('g:python_pep8_indent_multiline_string')
let g:python_pep8_indent_multiline_string = 0
endif

let s:maxoff = 50
if !exists('g:python_pep_8_indent_max_back_search')
let s:maxoff = 50
else
let s:maxoff = g:python_pep_8_indent_max_back_search
endif
let s:block_rules = {
\ '^\s*elif\>': ['if', 'elif'],
\ '^\s*except\>': ['try', 'except'],
Expand Down