branch: elpa/nix-mode
commit aa47e0c5aedf950a2bd945735efa180995f3dad3
Author: Jakub Piecuch <[email protected]>
Commit: Jakub Piecuch <[email protected]>
Fix indentation of lambdas starting at bol.
---
nix-mode.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index c03aef08f5..afb3aa96c1 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -444,9 +444,13 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(`(:after . ":")
;; Skip over the argument.
(smie-backward-sexp " -bseqskip- ")
- (if (smie-rule-bolp)
- `(column . ,(current-column))
- (nix-smie--indent-anchor)))
+ (cond
+ ((smie-rule-bolp)
+ `(column . ,(current-column)))
+ ((= (current-indentation) 0)
+ '(column . 0))
+ (t
+ (nix-smie--indent-anchor))))
(`(:after . ",")
(smie-rule-parent tab-width))
(`(:before . ",")