[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 9242165717 359/500: Don’t skip over > in angle-p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 9242165717 359/500: Don’t skip over > in angle-path |
Date: |
Sat, 29 Jan 2022 08:27:21 -0500 (EST) |
branch: elpa/nix-mode
commit 9242165717d15edb8655b77e64e5cb86d7a2c734
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Don’t skip over > in angle-path
Fixes #94
---
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 96d3401370..ebb4b6eb3c 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 676cc65daf 153/500: Add some README doc., (continued)
- [nongnu] elpa/nix-mode 676cc65daf 153/500: Add some README doc., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 732ce2f174 169/500: Remove case-fold-search setting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3a6634378a 149/500: Allow nix-repl be in custom location, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ea649349b5 156/500: Fix syntax issue, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9d0668f1d8 181/500: Ignore ''' in mmm-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3294f8a2f8 180/500: Merge pull request #37 from dieggsy/cl-lib, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode b580c8045b 192/500: Prefer derived-mode-p when checking for specific major modes, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d14dd9ce95 196/500: Don't assign to unbound variable: let-bind it locally instead, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 664fa51cfa 199/500: Remove mmm-mode/company feature detection, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1e72a297d7 238/500: update, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9242165717 359/500: Don’t skip over > in angle-path,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 1ebfda9810 368/500: Inline use of `signum`., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3022b9ef74 409/500: Skip descriptions in nix completions, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode aaf2b741fb 410/500: nix-shell: skip non-default packages integration, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 458c83f8bd 396/500: Correct pacakge lint for dep., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 59f3ea4da9 401/500: make run: use -Q, ELPA Syncer, 2022/01/29