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

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

[nongnu] elpa/annotate a51b5239b9 062/372: fixes incorrect annotation di


From: ELPA Syncer
Subject: [nongnu] elpa/annotate a51b5239b9 062/372: fixes incorrect annotation display for wide characters
Date: Fri, 4 Feb 2022 16:58:19 -0500 (EST)

branch: elpa/annotate
commit a51b5239b9500188c483cdbe88637ee561fc28e0
Author: Bastian Bechtold <basti@bastibe.de>
Commit: Bastian Bechtold <basti@bastibe.de>

    fixes incorrect annotation display for wide characters
    
    if the line contains characters wider than one column, annotations
    would not be displayed at the correct column.
---
 annotate.el | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/annotate.el b/annotate.el
index 99fac1ccf7..66441966f6 100644
--- a/annotate.el
+++ b/annotate.el
@@ -608,14 +608,12 @@ an overlay and it's annotation."
 (defun annotate-make-prefix ()
   "An empty string from the end of the line upto the annotation."
   (save-excursion
-    (move-end-of-line nil)
-    (let ((eol (point))
-          (prefix-length nil))
-      (move-beginning-of-line nil)
-      (setq prefix-length (- annotate-annotation-column (- eol (point))))
+    (let* ((line-text (buffer-substring
+                       (progn (beginning-of-line) (point))
+                       (progn (end-of-line) (point))))
+           (prefix-length (- annotate-annotation-column (string-width 
line-text))))
       (if (< prefix-length 2)
           (make-string 2 ? )
-
         (make-string prefix-length ? )))))
 
 (defun annotate-bounds ()



reply via email to

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