Remove restriction for annotation display

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2023-10-25 10:05:18 +02:00 committed by Thomas Lauf
parent b1c5d1c945
commit 054af9c1e9
2 changed files with 7 additions and 15 deletions

View file

@ -241,14 +241,7 @@ Table SummaryTable::Builder::build ()
if (_show_annotations)
{
auto annotation = track.getAnnotation ();
if (utf8_length (annotation) > 15)
{
annotation = utf8_substr (annotation, 0, 12) + "...";
}
table.set (row, annotation_col_index, annotation);
table.set (row, annotation_col_index, track.getAnnotation ());
}
const auto total = today.total ();

View file

@ -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
""")
def test_multibyte_char_annotation_truncated(self):
"""Summary correctly truncates long annotation containing multibyte characters"""
# Using a blue heart emoji as an example of a multibyte (4 bytes in
# this case) character.
long_enough_annotation = "a" + "\N{blue heart}" * 20
self.t("track FOO sod - sod")
def test_multibyte_char_annotation_wrapped(self):
"""Summary correctly wraps long annotation containing multibyte characters"""
# Using a blue heart emoji as an example of a multibyte (4 bytes in this case) character.
long_enough_annotation = "'" + ("a" + "💙" * 5 + " ") * 5 + "'"
self.t("track FOO sod - sond")
self.t("anno @1 " + long_enough_annotation)
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__":