emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/nix-mode 7c732faf3a 183/500: Handle smartparens in nix-mod


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode 7c732faf3a 183/500: Handle smartparens in nix-mode.
Date: Sat, 29 Jan 2022 08:27:04 -0500 (EST)

branch: elpa/nix-mode
commit 7c732faf3ae30f437e68b4cc810955fb2db9bbec
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>

    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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]