Skip to content

Add option g:pymode_indent_hanging_width for different hanging indentation width - #1138

Merged
diraol merged 1 commit into
python-mode:developfrom
wookayin:hanging-indent
Aug 13, 2021
Merged

diraol merged 1 commit into
python-mode:developfrom
wookayin:hanging-indent

Conversation

@wookayin

@wookayin wookayin commented Aug 12, 2021 •

Copy link
Copy Markdown
Contributor

This is an option for hanging indent size after an open parenthesis
in line continuations. It defaults to &shiftwidth but can be assigned
a different value.

For example, hanging indent size can be set to 4 (even if the tabsize
or shiftwidth is not 4) as per Google Python Style Guide (3.4. Indentation).

Example:

if True:
  pass     # 2 spaces are used for indentation

# 4-space hanging indent; nothing on first line
foo = long_function_name(
    var_one, var_two, var_three,
    var_four)

This is an option for hanging indent size after an open parenthesis
in line continuations. It defaults to `&shiftwidth` but can be assigned
a different value.

For example, hanging indent size can be set to 4 (even if the tabsize
or shiftwidth is not 4) as per Google Python Style Guide.

@diraol diraol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@diraol
diraol merged commit 4bc4581 into python-mode:develop Aug 13, 2021
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

Successfully merging this pull request may close these issues.

2 participants