You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Improve handling of multiline strings
Fixes#49.
* tests: use an uneven width (3) instead of 8
This makes sure that the tests work as expected.
* tests: move helper functions to spec_helper.rb
* Add python_pep8_indent_for_multiline_string setting
Ref: #49 (comment)
* Use indent directly if prevnonblank is known
This removes the now unused s:indent_prevnonblank function.
Copy file name to clipboardExpand all lines: README.rst
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,28 @@ Follow the instructions on installing NeoBundle_ and add the appropriate NeoBund
53
53
NeoBundle 'hynek/vim-python-pep8-indent'
54
54
55
55
56
+
Configuration
57
+
-------------
58
+
59
+
python_pep8_indent_multiline_string
60
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61
+
62
+
You can configure the initial indentation of multiline strings using ``g:python_pep8_indent_multiline_string`` (which can also be set per buffer).
63
+
This defaults to ``0``, which means that multiline strings are not indented.
64
+
``-1`` and positive values will be used as-is, where ``-1`` is a special value for Vim's ``indentexpr``, and will keep the existing indent (using Vim's ``autoindent`` setting).
65
+
``-2`` is meant to be used for strings that are wrapped with ``textwrap.dedent`` etc. It will add a level of indentation if the multiline string started in the previous line, without any content in it already::
66
+
67
+
testdir.makeconftest("""
68
+
_
69
+
70
+
With content already, it will be aligned to the opening parenthesis::
0 commit comments