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

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

[elpa] externals/embark d8ad4a28f9: REally fix #451 this time


From: ELPA Syncer
Subject: [elpa] externals/embark d8ad4a28f9: REally fix #451 this time
Date: Mon, 31 Jan 2022 01:57:32 -0500 (EST)

branch: externals/embark
commit d8ad4a28f9ebf95cc1d07c26fe5b7b658920e537
Author: Omar Antolín Camarena <omar.antolin@gmail.com>
Commit: Omar Antolín Camarena <omar.antolin@gmail.com>

    REally fix #451 this time
    
    @daanturo pointed out that the previous was wrong in certain cases and
    that the correct solution involves triming trailing newlines from the
    string being inserted. This change trims exactly one trailing newline
    from the string. Let's hope it's right this time.
---
 embark.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/embark.el b/embark.el
index 9469e47ecf..d566f78447 100644
--- a/embark.el
+++ b/embark.el
@@ -3351,11 +3351,10 @@ its own."
                (ins-string ()
                  (save-excursion
                    (insert string)
-                   (maybe-whitespace)
-                   (when (looking-at "\n\n")
-                     (delete-char 1)))
+                   (when (looking-back "\n" 1) (delete-char -1))   
+                   (maybe-whitespace))
                  (maybe-whitespace)))
-      (if buffer-read-only
+      (if buffer-read-only 
           (with-selected-window (other-window-for-scrolling)
             (ins-string))
         (ins-string)))))



reply via email to

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