branch: elpa/annotate commit a51b5239b9500188c483cdbe88637ee561fc28e0 Author: Bastian Bechtold <ba...@bastibe.de> Commit: Bastian Bechtold <ba...@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 ()