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

Invalid indentation when let is on independent line #30

Open
Slabity opened this issue Jan 23, 2020 · 0 comments
Open

Invalid indentation when let is on independent line #30

Slabity opened this issue Jan 23, 2020 · 0 comments

Comments

@Slabity
Copy link

Slabity commented Jan 23, 2020

Take a look at how vim-nix indents this code:

rec {
  test = let
    var = "value";
  in
  {
    inner_var = var;
  };
}

The indentation is correctly applied above. However, if the let keyword is given an independent line:

rec {
  test =
    let
      var = "value";
    in
    {
      inner_var = var;
    };
  }

You can see that the braces are not indented properly. This cascades further each time a let keyword is given its own line, which can make valid Nix look like this:

rec {
  testA =
    let
      var = "value";
    in
    {
      inner_var = var;
    };

    testB =
      let
        var = "value";
      in
      {
        inner_var = var;
      };

      testC =
        let
          var = "value";
        in
        {
          inner_var = var;
        };

        testD =
          let
            var = "value";
          in
          {
            inner_var = var;
          };
        }
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