mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Remove restriction for annotation display
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
b1c5d1c945
commit
054af9c1e9
2 changed files with 7 additions and 15 deletions
|
@ -241,14 +241,7 @@ Table SummaryTable::Builder::build ()
|
||||||
|
|
||||||
if (_show_annotations)
|
if (_show_annotations)
|
||||||
{
|
{
|
||||||
auto annotation = track.getAnnotation ();
|
table.set (row, annotation_col_index, track.getAnnotation ());
|
||||||
|
|
||||||
if (utf8_length (annotation) > 15)
|
|
||||||
{
|
|
||||||
annotation = utf8_substr (annotation, 0, 12) + "...";
|
|
||||||
}
|
|
||||||
|
|
||||||
table.set (row, annotation_col_index, annotation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto total = today.total ();
|
const auto total = today.total ();
|
||||||
|
|
|
@ -352,15 +352,14 @@ W\d{1,2} \d{4}-\d{2}-\d{2} .{3} ?0:00:00 0:00:00 0:00:00 0:00:00
|
||||||
[ ]+0:00:00
|
[ ]+0:00:00
|
||||||
""")
|
""")
|
||||||
|
|
||||||
def test_multibyte_char_annotation_truncated(self):
|
def test_multibyte_char_annotation_wrapped(self):
|
||||||
"""Summary correctly truncates long annotation containing multibyte characters"""
|
"""Summary correctly wraps long annotation containing multibyte characters"""
|
||||||
# Using a blue heart emoji as an example of a multibyte (4 bytes in
|
# Using a blue heart emoji as an example of a multibyte (4 bytes in this case) character.
|
||||||
# this case) character.
|
long_enough_annotation = "'" + ("a" + "💙" * 5 + " ") * 5 + "'"
|
||||||
long_enough_annotation = "a" + "\N{blue heart}" * 20
|
self.t("track FOO sod - sond")
|
||||||
self.t("track FOO sod - sod")
|
|
||||||
self.t("anno @1 " + long_enough_annotation)
|
self.t("anno @1 " + long_enough_annotation)
|
||||||
code, out, err = self.t("summary :anno")
|
code, out, err = self.t("summary :anno")
|
||||||
self.assertIn("a" + "\N{blue heart}" * 11 + "...", out)
|
self.assertRegex(out, r"(a💙{5} )\s{0,11}0:00:00")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue