disable auto-balancing in strict-mode per character?
Is there a way to turn off auto balancing for certain characters? When writing Common Lisp, or well most Lisps, it is pretty common to want to insert a single single-quote character, but I am also really enjoying the auto-balancing of strict-mode for double-quotes and parentheses.
Edit: This actually seems to only occur in my Common Lisp REPL's major-mode...source buffers behave as expected.
Thanks!
Most lisp buffers are configured with this snippet
(sp-with-modes (-difference sp-lisp-modes sp-clojure-modes)
;; also only use the pseudo-quote inside strings where it serve as
;; hyperlink.
(sp-local-pair "`" "'"
:when '(sp-in-string-p
sp-in-comment-p)
:unless '(sp-lisp-invalid-hyperlink-p)
:skip-match (lambda (ms mb me)
(cond
((equal ms "'")
(or (sp-lisp-invalid-hyperlink-p "`" 'navigate '_)
(not (sp-point-in-string-or-comment))))
(t (not (sp-point-in-string-or-comment)))))))
It should work if you add the repl mode to sp-lisp-modes variable before smartparens-config.el is loaded (so require smartparens, then add to the list, then require config).
If that works I'll gladly accept a pull request with the fix.
Oh, and the problem you had is actually this snippet here
(sp-with-modes sp-lisp-modes
;; disable ', it's the quote character!
(sp-local-pair "'" nil :actions nil))
So in the worst case you can just use the same declaration but pass your major mode into sp-local-pair (check the docstring for how it works if unsure).
This works great, thanks