[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 199e20413e 102/500: Ignore comments for hanging l
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 199e20413e 102/500: Ignore comments for hanging let's. |
Date: |
Sat, 29 Jan 2022 08:26:40 -0500 (EST) |
branch: elpa/nix-mode
commit 199e20413e01982813758ae965df1006594d69bd
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Ignore comments for hanging let's.
Fixes #10.
---
nix-mode.el | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index ee4bf4e480..2aeac02135 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -402,27 +402,27 @@
(beginning-of-line)
(let ((lets 0)
- (ins 0))
+ (ins 0))
(while (not (eq (point) (point-min)))
- (forward-line -1)
- (cond
- ((and
- (or
- (looking-at "[[:space:]]*let$")
- (looking-at "[[:space:]]*let[[:space:]]")
- (looking-at ".*[[:space:]]let$"))
- (not
- (or
- (looking-at ".*[[:space:]]in$")
- (looking-at ".*[[:space:]]in[[:space:]]"))))
- (setq lets (1+ lets)))
- ((or
- (looking-at "^in$")
- (looking-at "^in[[:space:]]")
- (looking-at "[[:space:]]+in$")
- (looking-at "[[:space:]]+in[[:space:]]"))
- (setq ins (1+ ins)))))
-
+ (forward-line -1)
+ (cond
+ ((save-excursion (end-of-line) (nth 4 (syntax-ppss))) nil)
+ ((and
+ (or
+ (looking-at "[[:space:]]*let$")
+ (looking-at "[[:space:]]*let[[:space:]]")
+ (looking-at ".*[[:space:]]let$"))
+ (not
+ (or
+ (looking-at ".*[[:space:]]in$")
+ (looking-at ".*[[:space:]]in[[:space:]]"))))
+ (setq lets (1+ lets)))
+ ((or
+ (looking-at "^in$")
+ (looking-at "^in[[:space:]]")
+ (looking-at "[[:space:]]+in$")
+ (looking-at "[[:space:]]+in[[:space:]]"))
+ (setq ins (1+ ins)))))
(- lets ins))))
(defun nix-indent-level-is-closing ()
- [nongnu] elpa/nix-mode e4e604ae3a 389/500: Release 1.4.4, (continued)
- [nongnu] elpa/nix-mode e4e604ae3a 389/500: Release 1.4.4, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 228f9f9d39 387/500: Release 1.4.3, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode bdfe3b3ae3 391/500: Fix nix-get-completions, add to nix-repl-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 70af0efc9f 076/500: Fix antiquote closing brace., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 59e9ca0abd 084/500: Improve fontification, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 68793d91c5 107/500: Add require 'cl for case statements., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2221a09aea 108/500: Require 'cl for "case"., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e4bc711d81 094/500: Add some more modes., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e1f2e24cc4 104/500: Move separate modes into own files., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 56a87c8d81 087/500: Move nix-flycheck to separate file., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 199e20413e 102/500: Ignore comments for hanging let's.,
ELPA Syncer <=
- [nongnu] elpa/nix-mode fcbaf3e054 106/500: Rename flycheck mode to "nix-flycheck"., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 542ae77358 110/500: buffer-substring can't bet <1., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3e6fdd8311 112/500: Add back syntax coloring of antiquotes., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 66cc5478de 113/500: Merge branch 'master' into separate-files, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0fd152e118 119/500: Merge pull request #22 from ljli/various, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 04a268a6fe 126/500: Remove "let" handling of indent., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1a4c98fcf7 118/500: Cosmetics, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 23bdbdf21f 124/500: Add custom mmm-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e413069e02 130/500: Fixup some corner cases in indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2def0ccd6a 191/500: Add autoload for company-nix command, ELPA Syncer, 2022/01/29