LnL7 / vim-nix

Vim configuration files for Nix http://nixos.org/nix
MIT License
287 stars 26 forks source link

A series of indentation fixes #19

Closed aszlig closed 5 years ago

aszlig commented 5 years ago

This adds tests plus a few fixes for indentation, mainly around let bindings.

For example things like this should now be indented correctly:

with import <nixpkgs> {};

let
  foo = "bar";
in foo
LnL7 commented 5 years ago

Did you get anywhere with the other issue?

aszlig commented 5 years ago

@LnL7: Not yet, just woke up :sleepy:

LnL7 commented 5 years ago

I'll merge this already since it's already an improvement.

Mic92 commented 5 years ago

I think this added a regression:

{
  src = { # now write enter };

}

This will extra indent the line with src for every newline that is inserted by two spaces:

{
    src = {
  };
}
{
      src = {

  };
}
LnL7 commented 5 years ago

Are you sure this is after the pr?

Mic92 commented 5 years ago

Indeed vim-polyglot needs an update: https://github.com/sheerun/vim-polyglot/blob/master/indent/nix.vim#L57