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

Arrays of modules overindented #126

Closed
alan-strohm opened this issue Oct 18, 2021 · 1 comment · Fixed by #127
Closed

Arrays of modules overindented #126

alan-strohm opened this issue Oct 18, 2021 · 1 comment · Fixed by #127

Comments

@alan-strohm
Copy link
Contributor

Example:

test:
  - role: foo
  - role: bar

While in insert mode, pressing ^F or at the end of the line 3 results in the following:

test:
  - role: foo
    - role: bar

Expected: no change in the indent.

Suggested fix (I'd be happy to send a pull request):
InGetAnsibleIndent, check to see if the current line matches array_entry. If so, return its current indent level (i.e. don't change the indentation). Alternatively, I could imagine always keeping the current indent level for any line with non-whitespace characters. The statement about gg=G in the README makes me think that indenting existing (e.g. non-empty) lines is not intended to be supported at this time.

@pearofducks
Copy link
Owner

Yep, I see this is working fine in the yaml filetype, so I'm up for fixing/improving this behavior for sure!

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 a pull request may close this issue.

2 participants