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

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

[nongnu] elpa/page-break-lines c133848345 44/80: Merge pull request #13


From: ELPA Syncer
Subject: [nongnu] elpa/page-break-lines c133848345 44/80: Merge pull request #13 from knu/char-width
Date: Tue, 5 Sep 2023 04:03:06 -0400 (EDT)

branch: elpa/page-break-lines
commit c133848345ceef91e257aab8804c61f31c31b264
Merge: 65fc27e4c8 4e5034de4b
Author: Steve Purcell <steve@sanityinc.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #13 from knu/char-width
    
    Adjust the length according to the width of page-break-lines-char
---
 page-break-lines.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/page-break-lines.el b/page-break-lines.el
index f80a9e42b2..91ff51879a 100644
--- a/page-break-lines.el
+++ b/page-break-lines.el
@@ -119,7 +119,11 @@ its display table will be modified as necessary."
             (setq buffer-display-table (make-display-table)))
           (let ((default-height (face-attribute 'default :height nil 
'default)))
             (set-face-attribute 'page-break-lines nil :height default-height)
-            (let* ((width (- (window-width window) 1))
+            (let* ((cwidth (char-width page-break-lines-char))
+                   (wwidth (window-width window))
+                   (width (if (zerop (% wwidth cwidth))
+                              (1- (/ wwidth cwidth))
+                            (/ wwidth cwidth)))
                    (glyph (make-glyph-code page-break-lines-char 
'page-break-lines))
                    (new-display-entry (vconcat (make-list width glyph))))
               (unless (equal new-display-entry (elt buffer-display-table ?\^L))



reply via email to

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