[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 519aab08ba 100/372: - added a better handling of
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 519aab08ba 100/372: - added a better handling of characters with width > 1. |
Date: |
Fri, 4 Feb 2022 16:58:22 -0500 (EST) |
branch: elpa/annotate
commit 519aab08ba3a9021d71f644bbc55898f82ccc6ae
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- added a better handling of characters with width > 1.
---
annotate.el | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/annotate.el b/annotate.el
index 97bbe294a2..919e4a45f3 100644
--- a/annotate.el
+++ b/annotate.el
@@ -554,6 +554,20 @@ to 'maximum-width'."
(join-until-width (cl-rest words)
new-word)
(make-annotate-group :words words
:start-word (or
word next-word)))))))
+ (split-position (text column-max-width)
+ (let ((character-width (length text))
+ (column-width (string-width text)))
+ (if (= character-width column-width)
+ column-max-width
+ (let* ((res 0)
+ (so-far ""))
+ (cl-loop for i from 0 below
column-max-width
+ until (>= (string-width so-far)
+ column-max-width)
+ do
+ (setf so-far (concat so-far
(string (elt text i))))
+ (setf res i))
+ res))))
(%group (words so-far)
(cond
((null words)
@@ -570,16 +584,17 @@ to 'maximum-width'."
(append (list potential-start)
so-far))))
(t
- (let* ((word (cl-first words))
- (rest-words (cl-rest words))
- (prefix (cl-subseq word 0 maximum-width))
- (next-word (if rest-words
- (cl-first rest-words)
- ""))
- (raw-suffix (cl-subseq word maximum-width))
- (suffix (if rest-words
- (concat raw-suffix " "
next-word)
- raw-suffix)))
+ (let* ((word (cl-first words))
+ (rest-words (cl-rest words))
+ (split-position (split-position word
maximum-width))
+ (prefix (cl-subseq word 0
split-position))
+ (next-word (if rest-words
+ (cl-first rest-words)
+ ""))
+ (raw-suffix (cl-subseq word split-position))
+ (suffix (if rest-words
+ (concat raw-suffix " "
next-word)
+ raw-suffix)))
(%group (append (list suffix)
(cl-rest rest-words))
(append (list prefix)
- [nongnu] elpa/annotate d84bfd56b8 103/372: Merge pull request #44 from cage2/master, (continued)
- [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, 2022/02/04
- [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 <=
- [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
- [nongnu] elpa/annotate a1be01d886 134/372: - try to guess the actual file name of an info document when showing, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 16e0346481 128/372: - prevent showing of summary window if metadata contains no annotations at all., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6ceeb44774 133/372: - removed check for buffer file name in funcion called just before a, ELPA Syncer, 2022/02/04