fix: signal loading with 'busy' instead of writing into the buffer #14
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/no-loading-text"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
Problem
Errors already went to
:messagesrather than into the buffer, but the loadingplaceholder was still written as buffer content:
That is the same category of mistake, and it was worse than cosmetic. On a
refresh it overwrote what you were reading before the fetch had returned
anything, and a refresh that then failed left the buffer reading
Loading job log...permanently —M.failonly cleared for a buffer that had never loaded,so a buffer that had loaded kept the placeholder instead of its log.
Solution
'busy'is the option for this. Nothing is written until the content itselfarrives.
A first open starts empty. A refresh keeps the old text on screen until the new
text replaces it, and keeps it for good if the fetch fails, which is what the
buffer promised all along.
vim.bo.busyexists on the supported floor.guh.nvimpairs it with progressmessages, but those need
nvim_echo'skind="progress", which guh can rely onbecause it requires 0.13+ and we cannot.
Two log buffers from different repositories both read "LOG ✓ Analyze | codeql", which is no help when both are open. b:ci.repo was already populated and simply unused. The checks list set status_hl and then never read it, because its winbar printed the whole header through b:ci.title. Splitting the rollup summary out into b:ci.status gives the two buffer kinds the same shape — status is the coloured state, title is the name — and puts the field to work: "20 running, 2 pending, 7/29 passing" now carries the worst bucket's colour. The separator lives inside the status expression rather than in a %( %) group around it, because a group containing %{%…%} is treated as empty and drops the whole segment. guh keeps its status out of such a group for the same reason.