[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 1697f18066 439/500: Fix #128
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 1697f18066 439/500: Fix #128 |
Date: |
Sat, 29 Jan 2022 08:27:54 -0500 (EST) |
branch: elpa/nix-mode
commit 1697f1806698e1e4f7be8ed4638cac5c6ac85c8f
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Fix #128
---
nix-mode.el | 4 ++--
tests/nix-mode-tests.el | 4 ++++
tests/testcases/issue-128.nix | 6 ++++++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index b0b0b77159..0c1c0596f6 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -733,8 +733,8 @@ not to any other arguments."
(let ((line (buffer-substring-no-properties
(line-beginning-position) (line-end-position))))
;; Then regex-match strings at the end of
the line to detect if we need to indent the line after.
;; We could probably add more things to look
for here in the future.
- (if (or (string-match "let$" line)
- (string-match "import$" line)
+ (if (or (string-match "\\blet$" line)
+ (string-match "\\bimport$" line)
(string-match "\\[$" line)
(string-match "=$" line)
(string-match "\($" line)
diff --git a/tests/nix-mode-tests.el b/tests/nix-mode-tests.el
index 106ad3ba13..6b4564e827 100644
--- a/tests/nix-mode-tests.el
+++ b/tests/nix-mode-tests.el
@@ -245,5 +245,9 @@ Related issue: https://github.com/NixOS/nix-mode/issues/94"
"Proper indentation of let expressions."
(with-nix-mode-test ("smie-let.nix" :indent 'smie-indent-line)))
+(ert-deftest nix-mode-test-indent-issue-128 ()
+ "Proper indentation of let expressions."
+ (with-nix-mode-test ("issue-128.nix" :indent 'nix-indent-line)))
+
(provide 'nix-mode-tests)
;;; nix-mode-tests.el ends here
diff --git a/tests/testcases/issue-128.nix b/tests/testcases/issue-128.nix
new file mode 100644
index 0000000000..8291fec36b
--- /dev/null
+++ b/tests/testcases/issue-128.nix
@@ -0,0 +1,6 @@
+[
+ foo
+ bar
+ networkmanagerapplet
+ baz
+]
- [nongnu] elpa/nix-mode e20afb51a4 370/500: Release 1.4.2, (continued)
- [nongnu] elpa/nix-mode e20afb51a4 370/500: Release 1.4.2, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e7fa834b80 383/500: Update nix-shell.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 21d3ba0b80 382/500: Update yaml again, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7487346812 378/500: Add flake, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 015bf9639a 386/500: Remove filenames handling, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0e3a8ef7a8 398/500: Check for process before completing in nix-repl, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 12d1e29ff1 397/500: Merge pull request #106 from jcs-PR/minor, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 8bc6750c4c 420/500: Update flake.lock., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1b1b9fb61d 440/500: Update nixos, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode f2acc55830 431/500: Add .dir-locals.el file, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1697f18066 439/500: Fix #128,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 04d9a86eae 437/500: Merge pull request #130 from nagy/simplify, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9362a70d0b 468/500: nix-flake: Organize the library into outlines, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 241cc0881e 466/500: nix-flake.el: Init nix-flake command, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode dd0d1c0d0b 467/500: nix-flake: WIP: nix-flake-init, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode acf4fd09db 470/500: nix-flake: Add customization options, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7346057087 471/500: nix-flake: Show aliases in the registry as well, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode de85646434 486/500: Add dependabot.yml, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 186698599c 480/500: nix-flake: Set a prompt string, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 6712a66321 381/500: Fix yaml, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1c42c634bf 379/500: Allow missing git repo, ELPA Syncer, 2022/01/29