[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 9ffdc1f762 060/372: fix for annotations with wide
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 9ffdc1f762 060/372: fix for annotations with wide characters |
Date: |
Fri, 4 Feb 2022 16:58:19 -0500 (EST) |
branch: elpa/annotate
commit 9ffdc1f76285445f2dfe1dfb594df49cbe290403
Author: Bastian Bechtold <bastian.bechtold@jade-hs.de>
Commit: Bastian Bechtold <bastian.bechtold@jade-hs.de>
fix for annotations with wide characters
---
annotate.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/annotate.el b/annotate.el
index 6de7866df5..bce9b77981 100644
--- a/annotate.el
+++ b/annotate.el
@@ -416,14 +416,18 @@ annotation plus the newline."
(substring text current-pos
(min (length text)
(+ current-pos available-width -1)))))
+ ;; discard characters until the string fits within the available width
+ ;; this can happen with unicode characters that are wider than one col
+ (while (> (string-width current-line) available-width)
+ (setq current-line (substring current-line 0 -1)))
;; strip partial last word if necessary, for word wrap:
(when (and (string-match "[^ ]$" current-line)
(< (+ current-pos (length current-line)) (length text)))
(string-match "[ ][^ ]+$" current-line)
(setq current-line (replace-match " " nil nil current-line)))
;; append white space to the end of continued lines
- (let ((postfix (if (< (+ current-pos (length current-line)) (length
text))
- (make-string (- available-width (length
current-line) 1) ? )
+ (let ((postfix (if (< (length current-line) (length text))
+ (make-string (- available-width (string-width
current-line) 1) ? )
"")))
(setq lineated (concat lineated current-line postfix "\n")
current-pos (+ current-pos (length current-line))))))
- [nongnu] elpa/annotate 856ebe246b 020/372: properly ignore non-annotation overlays, (continued)
- [nongnu] elpa/annotate 856ebe246b 020/372: properly ignore non-annotation overlays, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 8f252d2892 025/372: clear-annotations does not clear all overlays, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2084f831bc 026/372: added export functionality as sort-of-diffscuss, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 52f0d97e51 030/372: new version and documentation, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b0266c6350 047/372: version 0.4.1, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4647264264 049/372: auto-reflow annotations when frame size changes, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 785b5aea7f 042/372: rework annotation display logic, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d6a4fcc18e 035/372: add next-annotation and previous-annotation keys, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f5711b4f27 067/372: - prevent crash and error when a frame's width is less than value of, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1a43bfbb1e 061/372: fixes bug with annotations ending on beginning-of-line, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9ffdc1f762 060/372: fix for annotations with wide characters,
ELPA Syncer <=
- [nongnu] elpa/annotate 19acc501d8 086/372: - added/fixed more docstrings., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 774e643af4 081/372: - fixed retrocompatibility with old annotation file format., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4d78e3f6d6 073/372: - restored spaces to comply with markdown syntax;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 95da172588 056/372: readme improvement, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 54aefdec8d 114/372: Merge pull request #46 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 201b4587dc 136/372: - made recongnizable code that refers to info file annotation (1/3), ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate fd2cd2d94d 139/372: - made text snippet in summary window, for info files, less messy., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 75d291a69f 141/372: - using 'annotate-with-inhibit-modification-hooks'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 5b69043454 152/372: - added variable 'annotate-annotation-position-policy', ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 5b0bb094c9 166/372: - added known bug;, ELPA Syncer, 2022/02/04