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

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

[nongnu] elpa/paredit 8ee8f13 118/224: Fix `paredit-insert-pair' when bu


From: ELPA Syncer
Subject: [nongnu] elpa/paredit 8ee8f13 118/224: Fix `paredit-insert-pair' when buffer ends with no-newline comment.
Date: Sat, 7 Aug 2021 09:22:32 -0400 (EDT)

branch: elpa/paredit
commit 8ee8f1391fadaab6c39b1fdb7d1d004da9df4d05
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>

    Fix `paredit-insert-pair' when buffer ends with no-newline comment.
    
    Ignore-this: 18f0bece3d6a499eaec1befe180a4faf
    
    darcs-hash:20110409200610-00fcc-05f1a5029eaea4ab0600bb5ee3dfeb5efff55761
---
 paredit.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/paredit.el b/paredit.el
index 5fef46d..8cd3e19 100644
--- a/paredit.el
+++ b/paredit.el
@@ -742,6 +742,12 @@ If such a comment exists, delete the comment (including 
all leading
                                                  (prefix-numeric-value n))))
               (regionp
                (funcall forward (+ end (if spacep 2 1)))))
+        ;; The string case can happen if we are inserting string
+        ;; delimiters.  The comment case may happen by moving to the
+        ;; end of a buffer that has a comment with no trailing newline.
+        (if (and (not (paredit-in-string-p))
+                 (paredit-in-comment-p))
+            (newline))
         (insert close)
         (if (paredit-space-for-delimiter-p t close)
             (insert " "))))))



reply via email to

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