Closed FunTimeCoding closed 9 years ago
I see that too. Thanks for reporting this.
is there anything you can do about that? Im not that good at viml yet. Im also pondering to myself -how- the end of an indentation level can be detected by other means than the indentation itself.
my best guess is it shouldnt completely reindent everything, just make sure each value starts in steps of 2 spaces. everything further requires smart parsing of the salt state. and even there, I guess there could be overlapping situations where the indentation would have to guess whats right.
I think it should be possible. The way the indentation works now produces invalid yaml, so that's a start. Also it would make sense to try and continue the previous indentation for certain consecutive data types (list items, dictionary keys, etc).
Hopefully someone with some Viml foo will jump in here...or even someone without Viml foo that has some free time to figure it out. :)
@whiteinge Is this still an issue? It's been quite a while and I'm not sure if someone addressed it.
This is indeed still a thing.
Behavior is still there. The problem is that this particular parsing is a bit difficult -- we can't just de-indent on :
, because sometimes we want :
with no change in indent (if we're doing multiple keyword arguments, for example). I've never written vim indent files, but we would have to be able to look back at the previous line and see whether it begins in a -
or not.
I fixed the bug for all the examples I tried with, but I was unable to push the code. As it's the first time I collaborate in someone else's code, I don't know what would be the best method to share my code with you
@nacho-milanese, Awesome! So you'd want to fork the repo (https://help.github.com/articles/fork-a-repo/), commit your code to your copy of the repo (the fork), then make a pull request against this repo which will automatically create an issue that we'll review and submit feedback on if needed, then merge back into the master branch. The document I linked explains all the steps (or has links to them) regarding how to fork, push your code, and create the PR depending on your familiarity with Git. If you run into any problems feel free to add a comment, otherwise we'll see you in the Pull Request!
Thanks @gravyboat Pull Request done. Tested against several salt .sls examples and it seems to fix the issue
@nacho-milanese Awesome thanks a bunch!
when indenting using gg=G, the indentation does what its documented to do.
Every ':' the new line gets indented two more spaces. the problem is it never goes back.
..it just never removes the two spaces again when it should.