pub struct Editing<'a> {Show 16 fields
pub selection: Option<Selection>,
pub caret_on: bool,
pub layouts: Option<&'a BlockLayouts>,
pub annotations: &'a [(Selection, Annotation)],
pub placeholder: Option<SharedString>,
pub caption: Caption,
pub typography: Option<Typography>,
pub toggle: Option<Toggle>,
pub image: Option<OnImage>,
pub image_overlay: Option<ImageOverlay>,
pub image_overlay_corner: ImageOverlayCorner,
pub table_controls: bool,
pub copy: CopyButton,
pub base: Option<&'a Path>,
pub keep: &'a [usize],
pub scroll: Option<&'a ScrollHandle>,
}Expand description
What an editor paints over a document.
One value rather than six parameters, and the reason it is public: the
caret, the selection, the comment washes and the layout sink all arrive
together or not at all, and a read-only render sets none of them.
Fields§
§selection: Option<Selection>The caret and what it has selected. None paints neither — a document
nobody is editing.
caret_on: boolThe blink’s lit half. A caret painted on every frame reads as frozen, and the phase belongs to whoever owns the focus.
layouts: Option<&'a BlockLayouts>Filled as the document paints, for a caller resolving clicks against it.
Given, only the blocks near the part of the window the document shows are built, and it answers for those alone. The rest are placed at their last measured height, or a guess at one, and held in it across frames.
annotations: &'a [(Selection, Annotation)]Ranges washed under the text, in the order given.
placeholder: Option<SharedString>Shown on the caret’s block while it holds nothing.
caption: Caption§typography: Option<Typography>What to set the document in. None takes the installed
Typography — a caller sizing one document apart from the rest
passes Typography::scaled.
toggle: Option<Toggle>Makes a task block’s checkbox a control, and says who answers the
press. None paints a mark.
image: Option<OnImage>Handles a picture click with its block index, keeping the arrow cursor. A press and release more than a couple of pixels apart is a drag and calls nothing. The press still reaches whatever is under the picture.
image_overlay: Option<ImageOverlay>An app control inset at image_overlay_corner, visible on hover.
Its presses do not reach the picture. None adds no listeners.
image_overlay_corner: ImageOverlayCornerCorner for the picture control; defaults to bottom-right.
table_controls: boolReserves lanes around tables for editor controls.
copy: CopyButtonWhether a fence offers to copy itself.
base: Option<&'a Path>The directory a relative image path is joined onto. None leaves it
relative, which gpui reads against the process’s working directory.
keep: &'a [usize]Blocks built wherever they are, alongside the ones near the part of the
window the document shows — source lines, for render_source. The
caret’s and the selection anchor’s are built without being named. Only
read with layouts given.
scroll: Option<&'a ScrollHandle>The scroll container the document sits in. When blocks above the text
showing come out taller or shorter than they were placed at, its offset
moves by the difference. Only read with layouts given.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Editing<'a>
impl<'a> !Send for Editing<'a>
impl<'a> !Sync for Editing<'a>
impl<'a> !UnwindSafe for Editing<'a>
impl<'a> Freeze for Editing<'a>
impl<'a> Unpin for Editing<'a>
impl<'a> UnsafeUnpin for Editing<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().