Skip to content

Preserve indentation of wrapped annotations - #4189

Merged
djmitche merged 3 commits into
GothenburgBitFactory:developfrom
gregbell:fix/3914-annotation-indentation
Sep 10, 2026
Merged

djmitche merged 3 commits into
GothenburgBitFactory:developfrom
gregbell:fix/3914-annotation-indentation

Conversation

@gregbell

@gregbell gregbell commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Wrap each annotation separately and retain its indentation on continuation lines. Handle narrow columns and negative indentation, and add regression coverage.

Fixes #3914

Before

Taskwarrior 3.5.0; width=60; indent.annotation=2
 1 Task with annotations
     2025-09-08 A short annotation.
     2025-09-08 This longer annotation should remain
   indented when it wraps across several lines in a narrow
   report. Each continuation belongs to the annotation
   above.
     2025-09-08 Another short annotation.
 2 Task without annotations

After

 1 Task with annotations
     2025-09-08 A short annotation.
     2025-09-08 This longer annotation should remain
     indented when it wraps across several lines in a narrow
     report. Each continuation belongs to the annotation
     above.
     2025-09-08 Another short annotation.
 2 Task without annotations

Wrap each annotation separately and retain its indentation on
continuation lines. Handle narrow columns and negative indentation,
and add regression coverage.

Fixes GothenburgBitFactory#3914
libfaketime 0.9.13 rejects the s suffix in relative offsets.
Seconds are already the default unit, so use +5 and +1 to keep
these tests compatible with both older and newer versions.
@gregbell
gregbell force-pushed the fix/3914-annotation-indentation branch from 2d3cb5a to 16c2f49 Compare September 9, 2026 06:59

@djmitche djmitche left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good -- thanks!

Please remove the Changelog diff, and one additional question below.

Comment thread ChangeLog Outdated
Comment thread test/export.test.py
def test_export_end(self):
self.t("1 start")
self.t.faketime("+5s")
self.t.faketime("+5")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the motivation for this change?

@gregbell gregbell Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When CI ran, i get these errors from faketime on arch:

https://github.com/GothenburgBitFactory/taskwarrior/actions/runs/34319293173/job/102363309252#step:4:190
https://github.com/GothenburgBitFactory/taskwarrior/actions/runs/34319293173/job/102363309252#step:4:315

I'm not SUPER familiar with libfaketime. I saw this in the docs https://github.com/wolfcw/libfaketime/blob/v0.9.13/README#L348 and it doesn't say anything about an "s" modifier. So.. not entirely sure if it was removed or what, but this did get it passing with the newer build.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I wonder if we're using a "floating" version of that library. Anyway, thanks for the details!

Leave the release changelog to be generated from Git history.
@djmitche
djmitche merged commit 86dba1b into GothenburgBitFactory:develop Sep 10, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFE: Improve indentation of annotations on multiple lines

2 participants