[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 32b013cd62 363/500: Merge pull request #97 from N
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 32b013cd62 363/500: Merge pull request #97 from NixOS/fix-94 |
Date: |
Sat, 29 Jan 2022 08:27:21 -0500 (EST) |
branch: elpa/nix-mode
commit 32b013cd622a37cd553c8899332064397c90105b
Merge: ecf005009e 004c81e51d
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #97 from NixOS/fix-94
Don’t skip over > in angle-path
---
nix-mode.el | 10 +++++-----
tests/nix-mode-tests.el | 6 ++++++
tests/testcases/issue-94.nix | 6 ++++++
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index 203a412dc8..31c8efa1b1 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -418,7 +418,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(right " -bseqskip- ")
(left " -fseqskip- "))))))
-(defconst nix-smie--symbol-chars ":->|&=!</-+*?,;!")
+(defconst nix-smie--symbol-chars "[:->|&=!</-+*?,;!]")
(defconst nix-smie--infix-symbols-re
(regexp-opt '(":" "->" "||" "&&" "==" "!=" "<" "<=" ">" ">="
@@ -573,8 +573,8 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(point)
(progn
(or (/= 0 (skip-syntax-forward "'w_"))
- (/= 0 (skip-chars-forward nix-smie--symbol-chars))
- (skip-syntax-forward ".'"))
+ (when (looking-at nix-smie--symbol-chars) (forward-char) t)
+ (skip-syntax-forward "'"))
(point)))))
(defun nix-smie--forward-token ()
@@ -595,8 +595,8 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(point)
(progn
(or (/= 0 (skip-syntax-backward "'w_"))
- (/= 0 (skip-chars-backward nix-smie--symbol-chars))
- (skip-syntax-backward ".'"))
+ (when (looking-back nix-smie--symbol-chars) (backward-char) t)
+ (skip-syntax-backward "'"))
(point)))))
(defun nix-smie--backward-token ()
diff --git a/tests/nix-mode-tests.el b/tests/nix-mode-tests.el
index 9bbeff713c..6f41199a27 100644
--- a/tests/nix-mode-tests.el
+++ b/tests/nix-mode-tests.el
@@ -227,6 +227,12 @@ Related issue: https://github.com/NixOS/nix-mode/issues/72"
"Proper indentation of strings in a multi-line string."
(with-nix-mode-test ("issue-78.nix" :indent 'smie-indent-line)))
+(ert-deftest nix-mode-test-indent-issue-94 ()
+ "Proper indentation of attrsets inside of lists inside of attrsets.
+
+Related issue: https://github.com/NixOS/nix-mode/issues/94"
+ (with-nix-mode-test ("issue-60.1.nix" :indent 'smie-indent-line)))
+
(ert-deftest nix-mode-test-indent-lambdas-smie ()
"Proper indentation of function bodies."
(with-nix-mode-test ("smie-lambdas.nix" :indent 'smie-indent-line)))
diff --git a/tests/testcases/issue-94.nix b/tests/testcases/issue-94.nix
new file mode 100644
index 0000000000..4f77f31342
--- /dev/null
+++ b/tests/testcases/issue-94.nix
@@ -0,0 +1,6 @@
+let
+ nixpkgs = <nixpkgs>;
+ wrongIndentedLine = true;
+in {
+ a = "b";
+}
- [nongnu] elpa/nix-mode 7fbc65ae68 101/500: Merge pull request #16 from ljli/fontification-improvs, (continued)
- [nongnu] elpa/nix-mode 7fbc65ae68 101/500: Merge pull request #16 from ljli/fontification-improvs, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 070891aae4 105/500: Fix lexical bindings., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ae17e75812 120/500: First try at smie from damiencassou/nix-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c758b179e9 184/500: Add nix-shebang, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1b8b6f5eac 339/500: Add failing test that checks indentation of let expressions., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2bb0a0c1f4 340/500: Improve indentation of let expressions., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1b2f22f235 343/500: Add issue 84 test, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode aaef8580c5 351/500: Merge pull request #86 from j-piecuch/smie-tweaks, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4ffab960ef 345/500: Add AUTHORS.md to gitignore, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ecf005009e 361/500: Remove org-man.el from .texi makefile rule, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 32b013cd62 363/500: Merge pull request #97 from NixOS/fix-94,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 2c19243e2a 364/500: Revert fix for #94, but leave the test., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 55985b326b 366/500: Be smarter about tokenizing symbols., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode a54fc29289 372/500: Always “decompose” in nix-prettify-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c34990e956 371/500: Remove references to /gnu in nix-prettify-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9043a8d687 369/500: Merge pull request #98 from j-piecuch/94-fix, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode dc298e77b6 375/500: Merge pull request #101 from jgarte/patch-1, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode a3610b521f 385/500: Use NIX_GET_COMPLETIONS for Nix 3.0, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1dcbf13a1d 402/500: Merge pull request #111 from leungbk/make-run, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c52795de7d 392/500: Add completion-at-point to nix-repl-mode-map, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 75f383899a 395/500: Fixed styles., ELPA Syncer, 2022/01/29