Repository navigation
v0.2.1
A long document in the editor lays out only what the window shows, syntax colours in a text field follow its edits, an incremental syntax document, and a scrollbar thumb 2px off its edge.
New
syntax::document::Documentholds a source parsed across edits.edittakes the replaced byte range, where the new text ends and the whole text now, reparses from the old tree and answers the byte ranges whose spans may have changed;spansandspans_inanswer whatsyntax::highlightwould paint.Document::newanswersNonefor a wasm grammar and for a language with an injections query.ui::input::Editis one replacement in a field's text, asstart,old_endandnew_endbyte offsets.Edit::betweengives the smallest edit between two texts andEdit::mapcarries a byte range through one.ui::scroll::Overlay::marginsets the gap between the pane's edge and a scrollbar thumb, across the axis. It defaults to 2px, and the 10px track under the thumb keeps its width at any margin.Theme::EDGE(12) is the distance from a column's edge to the glyph of the control at the end of a row.ui::widgets::ICON_GLYPHis the icon button's glyph size andICON_EDGE_PADthe padding that sets an icon button's glyphEDGEfrom its container's edge.markdown::Editing::keepnames blocks, or source lines forrender_source, to build wherever they are, andEditing::scrollis the scroll container a document sits in.
Changed
- With
layoutsgiven,markdown::render_withandrender_sourcebuild only the blocks, or source lines, within half a screen of the part of the window the document shows, plus the caret's, the selection anchor's and those inkeep. The rest are placed at their last measured height or a guess from their length,BlockLayoutsanswers only for what was built, and heights above the first block showing that come out different moveEditing::scrollby the difference. markdown::Editinghaskeepandscrollfields; a struct literal without..Default::default()has to name them.FieldEvent::Changedcarries theEditthe field applied, andTextFieldmoves its syntax spans through each edit rather than leaving them where they were untilset_spans.Overlay::channelis gone;Overlay::marginplaces the thumb. A scrollbar thumb sits 2px from the pane's edge rather than 7px.markdown::Block,BlockKind,Text,MarkSpan,Mark,Form,QuoteKindandAlignderiveHash.Editor::selecton an editor without focus builds and reveals the selected block, keeping the reveal until the caret is in view.- Built on
bezel-gpui0.3.13.
Fixed
- Scrolling a long document in the editor costs time in proportion to the window rather than the document: 1000 sections scroll at about 1 ms a frame, down from 33 ms.
- Text and icons over a translucent background no longer carry a dark rim along their edges on macOS;
bezel-gpui0.3.13 blends the destination alpha with one minus the source alpha. - Syntax colours in a
TextFieldstay on their characters between an edit and the recolour that follows it.