Repository navigation
Fold long runs of unchanged lines, and show them on → or a click - #7
Merged
Merged
Conversation
The diff showed only three lines around each change, and the rest of the file was not there. Now the diff has the whole file, and a long run of unchanged lines folds into one row, "⋯ 13 unmodified lines", as in herdr-reviewr. → or a click on the row shows the lines. On a line of code, → still scrolls sideways. A fold with a comment on one of its lines always shows, and ":" with a line in a fold shows the fold. A new scope folds the lines again. Fixes #2
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.
Fixes #2. Stacked on #6.
Change
⋯ 13 unmodified lines @@ -27,7 +27,7 @@. Three lines show beside each change, as before. A run of one line shows, because its fold saves no row. The fold at the end of a file has no@@.→on a fold, or a click on it, shows its lines. The cursor goes to the first of them. On a line of code,→still scrolls sideways. The footer shows→ show the lineson a fold.:with a line in a fold shows the fold and goes to the line.Tests
diff.TestFolds: the exact rows (line numbers and folds) when no fold, the middle fold, the top and the tail fold, and every fold shows; the header text in both layouts; no line is wider than the screen.diff.TestFoldEdges: one line between two margins shows; an insert gives a fold different old and new numbers; a new file has no fold; the split layout has the same folds.tui.TestExpandFold:→on a fold shows its 13 lines and moves the cursor to line 14; the footer hint shows only on a fold;→on code scrolls.tui.TestClickFold: a click shows the tail fold in the unified layout, the split layout, and with wrap.tui.TestFoldKeepsComment: a comment on a line of an expanded fold keeps the fold open after a new scope.tui.TestGotoLineInFold::20shows the fold of line 20.→, a click,:20, and the split layout.Cost
A 20,000-line file with two changes renders in 3.3 ms, up from 3.0 ms.