[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode ff0a773d31 297/500: fix-issue-72: Check the corre
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode ff0a773d31 297/500: fix-issue-72: Check the correct element from syntax-ppss |
Date: |
Sat, 29 Jan 2022 08:27:15 -0500 (EST) |
branch: elpa/nix-mode
commit ff0a773d31123620c77bb501987a8f7968063f84
Author: Elis Hirwing <elis@hirwing.se>
Commit: Elis Hirwing <elis@hirwing.se>
fix-issue-72: Check the correct element from syntax-ppss
This is kinda a semi-revert from a small change in
bb602e160fa5bb8ae15b113ebf308f0fb30b3aa9 where the code:
"(nth 4 (syntax-ppss))"
was replaced with a function that did:
"(nth 3 (syntax-ppss))"
---
nix-mode.el | 2 +-
tests/nix-mode-tests.el | 6 ++++++
tests/testcases/issue-72.nix | 6 ++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/nix-mode.el b/nix-mode.el
index df664a36a3..707723f3ca 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -519,7 +519,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(defun nix-is-comment-p ()
"Whether we are in a comment."
- (nth 3 (syntax-ppss)))
+ (nth 4 (syntax-ppss)))
(defun nix-is-string-p ()
"Whether we are in a string."
diff --git a/tests/nix-mode-tests.el b/tests/nix-mode-tests.el
index a73a90c655..700b8e9d44 100644
--- a/tests/nix-mode-tests.el
+++ b/tests/nix-mode-tests.el
@@ -118,5 +118,11 @@ Related issue: https://github.com/NixOS/nix-mode/issues/69"
Related issue: https://github.com/NixOS/nix-mode/issues/69"
(with-nix-mode-test ("issue-60.2.nix" :indent t)))
+(ert-deftest nix-mode-test-indent-issue-72 ()
+ "Proper indentation of strings in a multi-line string.
+
+Related issue: https://github.com/NixOS/nix-mode/issues/72"
+ (with-nix-mode-test ("issue-72.nix" :indent t)))
+
(provide 'nix-mode-tests)
;;; nix-mode-tests.el ends here
diff --git a/tests/testcases/issue-72.nix b/tests/testcases/issue-72.nix
new file mode 100644
index 0000000000..94b11c487b
--- /dev/null
+++ b/tests/testcases/issue-72.nix
@@ -0,0 +1,6 @@
+# Test to make sure nix-mode indents the contents of the string two spaces.
+{
+ foo = ''
+ bar
+ '';
+}
- [nongnu] elpa/nix-mode 295cd6729b 261/500: Add nix-edit.el, (continued)
- [nongnu] elpa/nix-mode 295cd6729b 261/500: Add nix-edit.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode fde8c8e38c 268/500: Merge pull request #48 from dustinlacewell/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 90ac0a74b2 273/500: Merge pull request #55 from teozkr/issue-54, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 563f6bdb03 272/500: Fixed `nix-mode-comments` matching everything, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode abdeae0f23 276/500: Make sure nix-instantiate-executable exists before running it, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 57ea981cb2 278/500: Use eval-when-compile for subr-x, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1512d02830 279/500: Formatting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0c0ec7dbd6 281/500: ert/indent: Add macro to easily test indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7f968e8a7f 284/500: Merge pull request #61 from etu/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4ac7b5afb6 287/500: Add indent region function, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ff0a773d31 297/500: fix-issue-72: Check the correct element from syntax-ppss,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 1798168074 307/500: Use nix-indent-function when setting indent-line-function., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 022fac17a6 308/500: Un-delete nix-indent-line., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1cda7dabbc 309/500: Bug fix: replace memq with member, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4016a1c89b 321/500: Release 1.4.0, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 91834848b4 320/500: Generate AUTHORS.md, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0bab799a87 325/500: Add failing test that checks indentation of closing parens., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode dd5f937a49 331/500: Change the description of a couple of tests., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 10ac680cd6 332/500: Merge pull request #80 from j-piecuch/smie-tweaks, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 907336cd0b 337/500: Silence byte compiler warnings in nix-shell, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2f4bd0f09c 336/500: Release 1.4.1, ELPA Syncer, 2022/01/29