[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 4dc3e70920 059/372: fixes bug for too-wide charac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 4dc3e70920 059/372: fixes bug for too-wide characters |
Date: |
Fri, 4 Feb 2022 16:58:18 -0500 (EST) |
branch: elpa/annotate
commit 4dc3e70920c99b952bd9fcd06c0465c5c45e3afd
Author: Bastian Bechtold <bastian.bechtold@jade-hs.de>
Commit: Bastian Bechtold <bastian.bechtold@jade-hs.de>
fixes bug for too-wide characters
replaces `string-width` with `length` for calculating the length of a
string. This fixes a bug with non-monospace characters which might have
a longer `string-width` than `length`.
---
annotate.el | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/annotate.el b/annotate.el
index f363f864de..6de7866df5 100644
--- a/annotate.el
+++ b/annotate.el
@@ -230,7 +230,7 @@ An example might look like this:"
(point))))
(end-of-line)
(insert "\n" comment-start
- (make-string (max 0 (- ov-start bol (string-width
comment-start))) ? )
+ (make-string (max 0 (- ov-start bol (length comment-start)))
? )
(make-string (max 0 (- eol ov-start)) ?~)))
;; fully underline second to second-to-last line
(while (< (progn (forward-line)
@@ -242,14 +242,14 @@ An example might look like this:"
(point))))
(end-of-line)
(insert "\n" comment-start
- (make-string (max 0 (- eol bol (string-width
comment-start))) ?~))))
+ (make-string (max 0 (- eol bol (length comment-start)))
?~))))
;; partially underline last line
(let ((bol (progn (beginning-of-line)
(point)))
(ov-end (overlay-end ov)))
(end-of-line)
(insert "\n" comment-start
- (make-string (max 0 (- ov-end bol (string-width
comment-start))) ?~)))
+ (make-string (max 0 (- ov-end bol (length comment-start)))
?~)))
;; insert actual annotation text
(insert "\n" comment-start annotate-integrate-marker (overlay-get ov
'annotation)))
;; overlay is within one line
@@ -260,7 +260,7 @@ An example might look like this:"
(point))))
(end-of-line)
(insert "\n" comment-start
- (make-string (max 0 (- ov-start bol (string-width
comment-start))) ? )
+ (make-string (max 0 (- ov-start bol (length comment-start)))
? )
(if (= bol ov-start)
(make-string (max 0 (- ov-end ov-start 1)) ?~)
(make-string (max 0 (- ov-end ov-start)) ?~))
@@ -411,19 +411,19 @@ annotation plus the newline."
;; if the annotation won't fit at the end of the line:
(lineated (if (< line-width annotate-annotation-column) "" "\n"))
(current-pos 0))
- (while (< current-pos (string-width text))
+ (while (< current-pos (length text))
(let ((current-line
(substring text current-pos
- (min (string-width text)
+ (min (length text)
(+ current-pos available-width -1)))))
;; strip partial last word if necessary, for word wrap:
(when (and (string-match "[^ ]$" current-line)
- (< (+ current-pos (length current-line)) (string-width
text)))
+ (< (+ 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))
(string-width text))
- (make-string (- available-width (string-width
current-line) 1) ? )
+ (let ((postfix (if (< (+ current-pos (length current-line)) (length
text))
+ (make-string (- available-width (length
current-line) 1) ? )
"")))
(setq lineated (concat lineated current-line postfix "\n")
current-pos (+ current-pos (length current-line))))))
- [nongnu] elpa/annotate 6d74f53074 015/372: improve documentation and add license, (continued)
- [nongnu] elpa/annotate 6d74f53074 015/372: improve documentation and add license, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6b4b2b69d7 023/372: can now annotate long lines, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 39fc4bbda2 090/372: - added an annotation summary window, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d84bfd56b8 103/372: Merge pull request #44 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 253b5e2d7b 118/372: - try to elaborate a bit more the function goal., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f806eff4cc 142/372: Merge pull request #49 from cage2/annotate-info-files, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 40bd336a96 037/372: fix cl-related errors, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e199c77598 027/372: export format is now a valid unified diff, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e8c9b33b4d 051/372: fix unicode annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 676d9863f9 048/372: fix undo bug, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4dc3e70920 059/372: fixes bug for too-wide characters,
ELPA Syncer <=
- [nongnu] elpa/annotate cb8de5081a 078/372: Merge pull request #42 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 80e6b31c78 084/372: - fixed docstring., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 519aab08ba 100/372: - added a better handling of characters with width > 1., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d07e406251 097/372: - changed prefix for annotation in summary window., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate cf76d79c00 074/372: - fixed docstring., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3341c23e5f 038/372: don't annotate or save empty regions, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 242104e55a 108/372: - changed functions name, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 55e318b172 124/372: - fixed reference to a non-existent variable in the procedure that, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 08f520f09a 119/372: - try to elaborate more a function goal., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 354653496d 115/372: - added a bit of (very simple) heuristic to place annotation in the, ELPA Syncer, 2022/02/04