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

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

[nongnu] elpa/markdown-mode ece1dd8459 2/2: Merge pull request #755 from


From: ELPA Syncer
Subject: [nongnu] elpa/markdown-mode ece1dd8459 2/2: Merge pull request #755 from jrblevin/issue/753
Date: Mon, 6 Mar 2023 19:00:46 -0500 (EST)

branch: elpa/markdown-mode
commit ece1dd845904b08ab78598dc7e1a2eaf7875d1c4
Merge: f4567202bb 4071975ac7
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #755 from jrblevin/issue/753
    
    Consider character width to display horizontal rule in markdown-view-mode
---
 CHANGES.md             | 2 ++
 markdown-mode.el       | 6 +++---
 tests/markdown-test.el | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 8e546fb9e2..b87d47495f 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -26,6 +26,7 @@
     - Fix invalid italic fontification after bold markups[GH-731][]
     - Fix `markdown-live-preview-mode` fails when `eww-auto-rename-buffer` is 
non-nil[GH-737][]
     - Fix to mistake to handle the line as delimiter row[GH-747][]
+    - Fix wrong displaying horizontal rule in `markdown-view-mode` [GH-747][]
 
   [gh-572]: https://github.com/jrblevin/markdown-mode/issues/572
   [gh-705]: https://github.com/jrblevin/markdown-mode/issues/705
@@ -35,6 +36,7 @@
   [gh-739]: https://github.com/jrblevin/markdown-mode/issues/739
   [gh-743]: https://github.com/jrblevin/markdown-mode/issues/743
   [gh-747]: https://github.com/jrblevin/markdown-mode/issues/747
+  [gh-753]: https://github.com/jrblevin/markdown-mode/issues/753
 
 
 # Markdown Mode 2.5
diff --git a/markdown-mode.el b/markdown-mode.el
index 63a86ad701..d24356b53a 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -3507,14 +3507,14 @@ SEQ may be an atom or a sequence."
 (defun markdown-fontify-hrs (last)
   "Add text properties to horizontal rules from point to LAST."
   (when (markdown-match-hr last)
-    (let ((hr-char (markdown--first-displayable markdown-hr-display-char)))
+    (let* ((hr-char (markdown--first-displayable markdown-hr-display-char))
+           (hr-len (and hr-char (/ (window-max-chars-per-line) (char-width 
hr-char)))))
       (add-text-properties
        (match-beginning 0) (match-end 0)
        `(face markdown-hr-face
               font-lock-multiline t
               ,@(when (and markdown-hide-markup hr-char)
-                  `(display ,(make-string
-                              (1- (window-body-width)) hr-char)))))
+                  `(display ,(make-string hr-len hr-char)))))
       t)))
 
 (defun markdown-fontify-sub-superscripts (last)
diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index 2c3c885dcb..cf60533174 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -5241,7 +5241,7 @@ Sentence seven. Sentence eight.
     (forward-sentence 1)
     (looking-back "seven\\." (line-beginning-position))
     (forward-sentence 1)
-    (looking-at-p "$")))
+    (should (looking-at-p "$"))))
 
 ;;; Link tests:
 



reply via email to

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