From 9ac289883012a0c973addb0c8fe4db84259a8019 Mon Sep 17 00:00:00 2001 From: Matthew Carter Date: Fri, 9 Feb 2018 01:04:52 -0500 Subject: [PATCH] Update to allow more customizable handling of quotes in strings. --- lispy.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lispy.el b/lispy.el index 5fba25a6..3b7b833c 100644 --- a/lispy.el +++ b/lispy.el @@ -196,6 +196,11 @@ The hint will consist of the possible nouns that apply to the verb." :type 'boolean :group 'lispy) +(defcustom lispy-close-quotes-at-end-p nil + "If t, when pressing the `\"' at the end of a quoted string, it will move you past the end quote." + :type 'boolean + :group 'lispy) + (defcustom lispy-helm-columns '(70 80) "Max lengths of tag and tag+filename when completing with `helm'." :group 'lispy @@ -1681,8 +1686,10 @@ otherwise the whole string is unquoted." (not (= (point) (car bnd)))) (if arg (lispy-unstringify) - (insert "\\\"\\\"") - (backward-char 2))) + (if (and lispy-close-quotes-at-end-p (looking-at "\"")) + (forward-char 1) + (progn (insert "\\\"\\\"")) + (backward-char 2)))) (arg (lispy-stringify))