From aa3e9ab131ee04e450acda4db9fc4360e28077c2 Mon Sep 17 00:00:00 2001 From: sakurawald Date: Wed, 11 Dec 2024 10:35:15 +0800 Subject: [PATCH] fix: the paredit-splice should not backward 1 form if current point already at open-char --- extensions/paredit-mode/paredit-mode.lisp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/paredit-mode/paredit-mode.lisp b/extensions/paredit-mode/paredit-mode.lisp index b88bc1de6..e25bf830e 100644 --- a/extensions/paredit-mode/paredit-mode.lisp +++ b/extensions/paredit-mode/paredit-mode.lisp @@ -2,6 +2,7 @@ link : http://www.daregada.sakuraweb.com/paredit_tutorial_ja.html |# + (defpackage :lem-paredit-mode (:use :cl :lem) @@ -473,7 +474,11 @@ link : http://www.daregada.sakuraweb.com/paredit_tutorial_ja.html (delete-character end) (delete-character start)))) (t - (scan-lists start -1 1) + ;; If current-point is already at open-char, simply select current list. + (unless + (syntax-open-paren-char-p (character-at start)) + (scan-lists start -1 1)) + (when (syntax-open-paren-char-p (character-at start)) (with-point ((end start)) (scan-lists end 1 0)