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

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

[elpa] externals/ace-window 88e48db 56/92: ace-window.el: Fix leading ch


From: Stefan Monnier
Subject: [elpa] externals/ace-window 88e48db 56/92: ace-window.el: Fix leading char not displayed if the face height isn't 1.0
Date: Wed, 17 Mar 2021 18:39:21 -0400 (EDT)

branch: externals/ace-window
commit 88e48db56a176363121058b15b965324dc8e92c9
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ace-window.el: Fix leading char not displayed if the face height isn't 1.0
    
    Fixes #145
---
 ace-window.el | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/ace-window.el b/ace-window.el
index 3ba0cb8..c0fedfc 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -751,6 +751,16 @@ Modify `aw-fair-aspect-ratio' to tweak behavior."
   (aw--switch-buffer)
   (aw-flip-window))
 
+(defun aw--face-rel-height ()
+  (let ((h (face-attribute 'aw-leading-char-face :height)))
+    (cond
+      ((eq h 'unspecified)
+       1)
+      ((floatp h)
+       (1+ (floor h)))
+      (t
+       (error "unexpected: %s" h)))))
+
 (defun aw-offset (window)
   "Return point in WINDOW that's closest to top left corner.
 The point is writable, i.e. it's not part of space after newline."
@@ -758,10 +768,11 @@ The point is writable, i.e. it's not part of space after 
newline."
         (beg (window-start window))
         (end (window-end window))
         (inhibit-field-text-motion t))
-    (with-current-buffer
-        (window-buffer window)
+    (with-current-buffer (window-buffer window)
       (save-excursion
         (goto-char beg)
+        (when (member major-mode '(shell-mode))
+          (forward-line (- (aw--face-rel-height) 1)))
         (while (and (< (point) end)
                     (< (- (line-end-position)
                           (line-beginning-position))



reply via email to

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