-
Notifications
You must be signed in to change notification settings - Fork 77
Do not increase indention inside of comments following ':' #3
Comments
Should we fix the indent function in this project, or should we try to improve the standard YAML indent function? The YAML indent function already treats comments correctly. The only annoyance I have with it is that it does not indent correctly after |
Note the picture, it indents the line following the comment since the line ends with |
The indent file is setup to match common patterns in Ansible, which is what vim-ansible-yaml is all about. |
@benjifisher What do you mean it doesn't indent correctly after Most playbooks follow the format of: - name: Copy file
file: src=file.txt dest=newfile.txt Currently it indents after lines like |
Fixed in 7b806f8. |
Above, I wrote
By "The YAML indent function" I meant So I agree that this project (the Ansible indent function, |
Sorry, I came off fairly abrasive. I understand what you're saying now. Other than the comment indent issue that I fixed, the only thing I can think of is indenting for multi-line scalar values. That will probably get dealt with alongside #8. |
No offense taken. One problem I noticed with the indenting in this project is that it loses indent after a blank line:
It should be pretty easy to skip over empty lines by using vim's |
I understand how that could be annoying; however, I was trying to use that as a way to not have to manually remove indentation for sub-keys. How I see it: At the moment I'm having a hard time thinking up a solution that balances both approaches. |
Instead of backspace, you can use I am glad we had this discussion before I pushed a commit "fixing" what I did not like. ;) |
Thanks to you I just learned another feature of Vim after almost 4 years of constant use, haha. You're a wise man Dr. Fisher. What we could do is make a global flag for vim-ansible-yaml where your preferred behavior is default unless disabled. Something like |
(trying reply-by-email) Thanks. I am tempted to say that I am knowledgeable rather than wise. Are we agreed that indentation should be based on non-blank lines? If On Sun, Nov 16, 2014 at 10:17:37AM -0800, Chase Colman wrote:
|
I agree that indentation should be based on non-blank lines, yes, so long as the behavior includes the aforementioned flag so people can switch back to the old behavior. As a mentor once told me, wisdom comes from not only experience but the knowledge gained along the journey, related or not. So perhaps a bit of both 👍 |
I changed the indent function as we agreed. At first, I did it on the train, with lousy wifi, and I forgot that you suggested changing the default behavior, so I kept the default behavior. Then I made a second commit to change it. I updated the README. I may also add |
Should be a simple fix, but indentation of comments should remain constant.
This should not occur:
The text was updated successfully, but these errors were encountered: