Click target to expand/collaps element gets offset #5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Bug, Once the output history reaches a multi screen size the click area to expand/collapse an element drifts away from the element displayed position itself.
Fixed on
maininb7214ea, released asv0.10.2.Root cause: commit
8bd1dc8wrapped the concatenated output withfitOutputWidth(ansi.Hardwrap) so over-wide lines are not truncated. The wrap inserts real newlines, but the entry coordinate math still measured entries withrenderedHeighton the unwrapped text (entryAtLine,scrollToEntry,clickToggles). Each wrapped line above a block added an uncounted viewport row, so the click target drifted further the longer the output history.Fix:
refreshViewportwraps each entry and stores the wrapped row count inentry.height; the hit-test/scroll code uses it.e.renderedstays unwrapped so resizing re-wraps entries that are not re-rendered, and the streaming markdown tail is wrapped explicitly. This fixes mouse collapse/expand toggling, border hit-testing and[/]block scrolling together.Tests:
TestClickTogglesAfterWrappedOutput(verified failing before the fix) andTestEntryHeightsMatchViewportContent;gofmt,go vet ./...,go test -count=1 ./...pass.Leaving open for verification.