The pager opens one entry back out of the join - #152
Open
torstei wants to merge 1 commit into
Open
Conversation
`z` renders every multi-line entry as one row, which is what makes ten stack traces comparable at all — and the next thing after picking one out of the ten is reading it. `Z` opens the entry under the cursor back into its own lines while the other nine stay rows to come back to; pressing it again joins it, from any of its lines, since what the reader is pointing at is the entry and not the row. Several can be open at once, because comparing two of them is what picking them out was for. It is an exception to a rendering rather than a second mode: an open entry is rendered from the source's OWN lines, so its framing is the entry framing again — the entry motion steps over the whole trace and a bare `c` still copies all of it — and `z`, which sets the whole screen, builds the join afresh and so clears the exceptions. An open entry is remembered by its ORDINAL, the nth entry of the source, against the pager's habit of holding every position as an offset: an entry still at a live edge has none, and every one of them reports 0, so a set of offsets would open all of the live-edge entries together. An answer is a closed set, so the nth entry stays the nth — and the tape, where the run does renumber, has no multi-line entry to open in the first place. The place-keeping `z` already did — the cursor and both ends of a region travelling as offsets, the upper one widened to the end of the entry it lands in — is now shared with `Z` rather than written twice: the rows renumber the same way under both, and a region that quietly became a different set of lines is the copy that takes the wrong thing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
zrenders every multi-line entry as one row, which is what makes ten stacktraces comparable at all — and the next thing after picking one out of the ten
is reading it.
Zopens the entry under the cursor back into its own lineswhile the other nine stay rows to come back to; pressing it again joins it,
from any of its lines, since what the reader is pointing at is the entry and
not the row.
Several can be open at once, because comparing two of them is what picking
them out was for. It is an exception to a rendering rather than a second
mode: an open entry is rendered from the source's OWN
Lineobjects, so itsframing is the entry framing again — the entry motion steps over the whole
trace, the bold copy target covers it, and a bare
cstill takes all of it —and
z, which sets the whole screen, builds the join afresh and so clears theexceptions.
⚠ An open entry is remembered by its ordinal, the nth entry of the source,
against this pager's habit of holding every position as an offset: an entry
still at a live edge has none, and every one of them reports
0, so a set ofoffsets would open all of the live-edge entries together. An answer is a
closed set, so the nth entry stays the nth — and the tape, where the run does
renumber, has no multi-line entry to open in the first place.
The place-keeping
zalready did — the cursor and both ends of a regiontravelling as offsets, the upper one widened to the end of the entry it lands
in — is now shared with
Z(View._rerender) rather than written twice: therows renumber the same way under both, and a region that quietly became a
different set of lines is the copy that takes the wrong thing.
Tests
Four new ones in
tests/timberview/test-timberview, andz/Zare driventhrough
Screen.stepin one of them because a binding nothing exercises is onea refactor can lose:
entry one entry to
entry_span,cand the entry motion — closing worksfrom a continuation line, and a one-line entry says there is nothing folded in
zround triptest the ordinal keying exists for
Zin both directions71/71 timberview, 42/42 timbersh, 39/39 client.
Docs
?in the pager,timberview(1), the pager section oftools/README.md, anda new Built: ten traces on one screen, and one of them opened section in
docs/plans/view.md.