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

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

[elpa] externals/diff-hl 1af31fe 2/2: Merge pull request #160 from alvar


From: ELPA Syncer
Subject: [elpa] externals/diff-hl 1af31fe 2/2: Merge pull request #160 from alvarogonzalezsotillo/better-inline-popup-in-terminal
Date: Thu, 18 Mar 2021 10:57:09 -0400 (EDT)

branch: externals/diff-hl
commit 1af31fe1c177646ef7419c95b5d9c25655187ceb
Merge: 9cadf39 d3efd94
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: GitHub <noreply@github.com>

    Merge pull request #160 from 
alvarogonzalezsotillo/better-inline-popup-in-terminal
    
    Last line of inline-popup properly underlined in terminal.
---
 diff-hl-inline-popup.el | 4 ++--
 diff-hl-show-hunk.el    | 9 +++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/diff-hl-inline-popup.el b/diff-hl-inline-popup.el
index fae9236..c0c501d 100644
--- a/diff-hl-inline-popup.el
+++ b/diff-hl-inline-popup.el
@@ -104,8 +104,8 @@ Default for CONTENT-SIZE is the size of the current lines"
          (new-width (- width (length footer) (length scroll-indicator)))
          (blank-line (if (display-graphic-p)
                          ""
-                       (propertize (concat "\n" 
(diff-hl-inline-popup--separator width))
-                                   'face '(:underline t))))
+                       (concat "\n" (propertize 
(diff-hl-inline-popup--separator width)
+                                   'face '(:underline t)))))
          (line (propertize (concat (diff-hl-inline-popup--separator new-width)
                                    footer scroll-indicator)
                            'face '(:overline t))))
diff --git a/diff-hl-show-hunk.el b/diff-hl-show-hunk.el
index 5d109c4..2be7a06 100644
--- a/diff-hl-show-hunk.el
+++ b/diff-hl-show-hunk.el
@@ -310,10 +310,11 @@ of `diff-hl-show-hunk'."
 (defun diff-hl-show-hunk--goto-hunk-overlay (overlay)
   "Tries to display the whole overlay, and place the point at the
 end of the OVERLAY, so posframe/inline is placed below the hunk."
-  (goto-char (overlay-start overlay))
-  (when (< (point) (window-start))
-    (set-window-start nil (point)))
-  (goto-char (1- (overlay-end overlay))))
+  (when (and (overlayp overlay) (overlay-buffer overlay))
+    (goto-char (overlay-start overlay))
+    (when (< (point) (window-start))
+      (set-window-start nil (point)))
+    (goto-char (1- (overlay-end overlay)))))
 
 ;;;###autoload
 (defun diff-hl-show-hunk-next ()



reply via email to

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