vscode-python: Indent when doing line breaks

Feedback from twitter here: https://twitter.com/amuellerml/status/1060895092230291457

Actual behavior

a = 1 + \
<--- indent is here

Expected behavior

a = 1 + \
    <--- indent is here

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 4
  • Comments: 17 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Adding this seems to work (handling comments and ignoring all-whitespace prefixes):

{
    beforeText: /^(?!\s+\\)[^#\n]+\\\s*/,
    action: { indentAction: IndentAction.Indent }
},

continuation_fixed

Tests: https://regex101.com/r/kfNBtR/1

#481 is certainly related because it also concerns proper PEP8-style indentation.