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

Autoindent on => #71

Open
rski opened this issue Oct 17, 2016 · 1 comment
Open

Autoindent on => #71

rski opened this issue Oct 17, 2016 · 1 comment

Comments

@rski
Copy link
Member

rski commented Oct 17, 2016

It'd be nice to see feature parity with the vim plugin on this.

I guess the clean way to implement this would depend on #7

@rski
Copy link
Member Author

rski commented Nov 1, 2016

A couple of points about this:

  • calling the align block function assumes that a block is closed, so trying to call it on something like
file {'foo':
  a => 'a',
  bb => 'b',

will fail.
With smartparens/other package that autocloses brackets you can (ab)use hooks to make it work though like i have (gitlab)

  • the vim plugin overloads > to align arrows and then it uses some obscure combination of regexes and heuristics to figure out where unclosed blocks end. It works on minimal cases but quite easy to break with a bit of imagination, bad luck or nesting. All in all, it might not be a good implementation to copy.

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

No branches or pull requests

1 participant