Repository navigation
Conversation
In the Markdown dual view, the wheel over the preview stalled inside a drawn code block: notch after notch moved nothing on screen, and with the source pane syncing to it the preview could snap back several rows, so it could not be scrolled smoothly past a diagram. The row index the wheel and the scroll sync step through was keyed by a geometry that wrapped every pane at its width less the line-number gutter. A compose pane lays its text out in the compose layout's area instead, and keeps the gutter only where the desk margin has room for it; a preview narrower than its compose width, like each half of the dual view, has no margin, so it drops the gutter and draws at the full width. A drawing framed to that width counted as two rows a line in the index and drew as one, and the scroll stepped through rows that were not on screen. `wrap_area_for` now states the width and gutter a pane lays text out at, the way `resolve_gutter_layout` resolves them for the frame, and the wrap index geometry and the scrollbar's row counts both read it. Source panes keep the width they had. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012MC4RTeiS6hZV3vHLXYqD9
The dual view's preview still could not be scrolled through a drawing: each wheel notch moved it a row, and the frames after it put it back. The preview is taller than the source, so a notch can stop it between two positions of the source (`inverse_synced_top`), and the source stays put. The frame after, the focused source pane drives the sync; the guard for "the focus moved and nothing has scrolled" kept the pair, but recorded the source as the driver. On the next frame the source drove again, that guard no longer applied, and the preview was re-derived from the source's top: back onto the curve, a row or more above where the wheel left it. Any redraw or idle tick did it, so a notch lasted a frame or two. A sync now leaves the pair where it is whenever nothing has moved since the last one, whichever pane drove it. The regression test renders idle frames after each notch, which is what exposed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012MC4RTeiS6hZV3vHLXYqD9
This branch has not been deployed
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.
The bug: in the Markdown dual view, scrolling the preview with the wheel stalls inside a drawn code block. Notch after notch moves nothing on screen. Because the source pane syncs to the preview, the preview can also snap back several rows, so it can't be scrolled smoothly past a diagram.
Cause:
resolve_gutter_layout).Fix:
wrap_area_forgives the width and gutter a pane lays its text out at, resolved the same way the renderer does.Test:
the_wheel_scrolls_a_dual_preview_a_row_a_notch_through_a_drawing, inmarkdown_compose_mermaid_latex.rs. It sets the wheel to 1 line per notch and scrolls the preview of a dual view through an 8-row drawing.ROW 1, ROW 1, ROW 2, ROW 2, ROW 3, ROW 3, ROW 4…Checks:
Unit tests pass: 2,768.
The markdown, scroll, wrap, compose and sync e2e tests pass: 754.
One terminal-scrollback test failed once under that parallel run. It passes on its own, both with and without this change.
cargo fmtis clean, andcargo clippyshows no warnings in the changed files.I agree my contributions are licensed under GPL-3.0-or-later and may be relicensed in the future at the maintainer's discretion (see CONTRIBUTING.md).
Generated by Claude Code