Pass scalar lengths and include colors when specifying styling runs during text layout - #71
Merged
Merged
Conversation
Also move from the runs being expressed as ranges to the runs being expressed as a sequence of contiguous scalar lengths.
Anthony-Eid
pushed a commit
to Anthony-Eid/zed
that referenced
this pull request
Dec 5, 2024
* Add sync active debug line over collab * Remove unused downcast * Remove unused import
ShalashaskaOcelot
pushed a commit
to ShalashaskaOcelot/zed
that referenced
this pull request
Aug 7, 2026
Five bugs from the phase 63/64 test round, all filed in bugs.md with analysis. zed-industries#67 A vertical wheel dragged wide tables sideways while the notebook scrolled. gpui applies a wheel's other-axis delta to an element that scrolls in only one direction unless restrict_scroll_to_axis is set; the table now sets it, so it answers only to horizontal input and vertical wheels pass through. zed-industries#68 The horizontal scrollbar slid out from under the pointer when dragged: it was applied to the same element that scrolls, so it was laid out in content space and translated with the content. The scroll container is now a child of a plain wrapper that carries the scrollbars, matching ui's data_table. zed-industries#69 Column titles wrapped their last character even with room to spare. Headers render semibold but every column width was measured at regular weight, leaving each column a few pixels short of its own title. Titles are now measured semibold. zed-industries#70 Columns didn't line up row to row: in fill-width mode cells had grow factors but no flex basis, so each cell started from its own content width and every row distributed spare space differently. flex_basis(0) makes the split depend only on the per-column grow factors. zed-industries#72 Kernel status stuck on "Starting" until a cell ran. Kernels broadcast status: starting as they come up, and that message can land after the launch task has already installed the kernel as Running/Idle — overwriting it, with nothing to correct it until the next execution. A connected kernel is past starting, so that state is now ignored for a RunningKernel. Also filed zed-industries#71 (a cell being edited stops accepting input once scrolled out of view) undiagnosed, and backlogged a distinct "creating environment" state for the kernel strip, which currently shows the misleading "Starting" during a build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JkvYRuX9r6PmLXpxNie2R7
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…t-layout Pass scalar lengths and include colors when specifying styling runs during text layout
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.
This PR is laying the foundation for syntax highlighting.
It changes how we specify runs of styling when calling
TextLayoutCache::layout_str. Previously, you would pass arunsargument of type&[Range<usize>, FontId]. Colors where specified separately when painting the line.For syntax highlighting, we realized it would be helpful to unify our handling of colors and fonts in a single interface. So now you pass a
ColorUin addition to theFontIdas part of each run. We still ignore colors for the purposes of caching the text layouts by coalescing contiguous runs with the same font before calling into CoreText.Additionally, rather than specifying a start and end range for each run, you now simply pass the run's length in bytes.