fix: rebuild the timestamp column on reload instead of leaving it stale #25

Merged
barrettruth merged 2 commits from fix/timestamps-survive-reload into main 2026-07-28 00:03:52 +00:00
Owner

Checklist

  • I have read CONTRIBUTING.md.
  • No AI was used to generate, edit, or review any part of this contribution.

Stacked on #24.

Problem

buf.load clears the ANSI namespace but not the one the timestamps live in, so
their marks outlived the text they described:

gS on:     marks=2562  ci_times=true
after R:   marks=2562  ci_times=true   ← never rebuilt

Refreshing the same job hides it, because identical stamps land on identical
lines. But the reason to press R on a job is that its log has grown, and then
every stamp sits against the wrong line.

The flag persisted too, so the next gS turned the column off at a point
where it looked like it was already off.

Solution

Rendering clears the column before painting and restores it afterwards if it
was showing, so the marks always describe the text beneath them:

fresh:     marks=0     ci_times=false
gS on:     marks=2562  ci_times=true
after R:   marks=2562  ci_times=true
gS off:    marks=0     ci_times=false
R w/ off:  marks=0     ci_times=false

Showing and hiding were two spellings of the same operation, so they collapse
into one times(buf, on) that clears unconditionally and repopulates when
asked. M.timestamps is now just the toggle.

## Checklist - [x] I have read [CONTRIBUTING.md](https://forge.barrettruth.com/barrettruth/ci.nvim/src/branch/main/CONTRIBUTING.md). - [ ] No AI was used to generate, edit, or review any part of this contribution. > Stacked on #24. ## Problem `buf.load` clears the ANSI namespace but not the one the timestamps live in, so their marks outlived the text they described: ``` gS on: marks=2562 ci_times=true after R: marks=2562 ci_times=true ← never rebuilt ``` Refreshing the *same* job hides it, because identical stamps land on identical lines. But the reason to press `R` on a job is that its log has grown, and then every stamp sits against the wrong line. The flag persisted too, so the next `gS` turned the column *off* at a point where it looked like it was already off. ## Solution Rendering clears the column before painting and restores it afterwards if it was showing, so the marks always describe the text beneath them: ``` fresh: marks=0 ci_times=false gS on: marks=2562 ci_times=true after R: marks=2562 ci_times=true gS off: marks=0 ci_times=false R w/ off: marks=0 ci_times=false ``` Showing and hiding were two spellings of the same operation, so they collapse into one `times(buf, on)` that clears unconditionally and repopulates when asked. `M.timestamps` is now just the toggle.
Reloading cleared the ANSI namespace but not the one the timestamps live in,
so their marks outlived the text they described. Refreshing the same job hid
it, since identical stamps landed on identical lines, but the whole reason to
refresh a job is that its log has grown, and then every stamp is against the
wrong line. The flag stayed set too, so the next gS turned the column off
when it looked like it was already off.

Rendering now clears the column before painting and puts it back afterwards
if it was showing, so the marks always describe the text underneath them.
barrettruth changed target branch from chore/drop-dead-fields to main 2026-07-28 00:03:45 +00:00
barrettruth deleted branch fix/timestamps-survive-reload 2026-07-28 00:03:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
barrettruth/ci.nvim!25
No description provided.