branch: elpa/nix-mode
commit 7c732faf3ae30f437e68b4cc810955fb2db9bbec
Author: Matthew Bauer <[email protected]>
Commit: Matthew Bauer <[email protected]>
Handle smartparens in nix-mode.
Could have some issue but this tells smartparens how to deal with ', ", and
'’
in nix-mode.
---
nix-mode.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/nix-mode.el b/nix-mode.el
index 27308320b3..c778e522d3 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -536,5 +536,11 @@ The hook `nix-mode-hook' is run when Nix mode is started.
(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))
(add-to-list 'auto-mode-alist '("\\.nix.in\\'" . nix-mode)))
+(when (featurep 'smartparens)
+ (sp-with-modes 'nix-mode
+ (sp-local-pair "'" "'" :unless '(sp-in-comment-p sp-in-string-quotes-p))
+ (sp-local-pair "\"" "\"")
+ (sp-local-pair "''" "''" :unless '(sp-in-comment-p
sp-in-string-quotes-p))))
+
(provide 'nix-mode)
;;; nix-mode.el ends here