pub struct EditorState { /* private fields */ }Implementations§
Source§impl EditorState
impl EditorState
Sourcepub fn caret_table_align(&self) -> Option<CellAlign>
pub fn caret_table_align(&self) -> Option<CellAlign>
The alignment of the table column the caret sits in — but only while the
caret is in the table’s HEADER row (the toolbar lives there; alignment is a
per-column property, set once from the header). None otherwise. Read from
the current content, since the painted table_rows lag a frame right after
a separator rewrite (which would highlight the just-changed-from button).
Sourcepub fn set_caret_table_align(
&mut self,
align: CellAlign,
cx: &mut Context<'_, Self>,
)
pub fn set_caret_table_align( &mut self, align: CellAlign, cx: &mut Context<'_, Self>, )
Set the alignment of the caret’s table column by rewriting that table’s
|---| separator row; the caret stays put. No-op outside a table cell.
Sourcepub fn insert_table_row(&mut self, below: bool, cx: &mut Context<'_, Self>)
pub fn insert_table_row(&mut self, below: bool, cx: &mut Context<'_, Self>)
Insert an empty row above/below the caret’s row (Word-style); the caret moves into the new row’s first cell. No-op outside a table.
Sourcepub fn delete_table_row(&mut self, cx: &mut Context<'_, Self>)
pub fn delete_table_row(&mut self, cx: &mut Context<'_, Self>)
Delete the caret’s table row (body rows only — the header + separator stay). The caret keeps its cell + in-cell offset, landing on the row that takes the deleted row’s place. No-op outside a table.
Sourcepub fn delete_table(&mut self, cx: &mut Context<'_, Self>)
pub fn delete_table(&mut self, cx: &mut Context<'_, Self>)
Delete the whole table the caret is in — its grid lines plus an optional
<!-- table:STYLE --> marker line directly above — joining the surrounding
text. The caret lands where the table was.
Sourcepub fn duplicate_table_row(&mut self, cx: &mut Context<'_, Self>)
pub fn duplicate_table_row(&mut self, cx: &mut Context<'_, Self>)
Duplicate the caret’s row below itself (the header duplicates as the first body row). The caret lands in the copy, same cell + offset.
Sourcepub fn copy_table(&mut self, cx: &mut Context<'_, Self>)
pub fn copy_table(&mut self, cx: &mut Context<'_, Self>)
Copy the caret’s table — its grid source plus any <!-- table:STYLE -->
marker — to the clipboard (markdown, pasteable anywhere).
Sourcepub fn set_table_style(
&mut self,
name: Option<&'static str>,
cx: &mut Context<'_, Self>,
)
pub fn set_table_style( &mut self, name: Option<&'static str>, cx: &mut Context<'_, Self>, )
Set the caret table’s visual style (None = Grid, the default),
preserving any drag-resized cols= widths in the marker.
Sourcepub fn insert_table_column(&mut self, right: bool, cx: &mut Context<'_, Self>)
pub fn insert_table_column(&mut self, right: bool, cx: &mut Context<'_, Self>)
Insert an empty column left/right of the caret’s column (a cell added to every row; the separator gets a default-left marker). The caret stays in its cell. No-op outside a table.
Sourcepub fn delete_table_column(&mut self, cx: &mut Context<'_, Self>)
pub fn delete_table_column(&mut self, cx: &mut Context<'_, Self>)
Delete the caret’s column from every row; the caret stays near where the column was. No-op outside a table, or on the last remaining column.
Source§impl EditorState
impl EditorState
pub fn new(_window: &mut Window, cx: &mut Context<'_, Self>) -> Self
Sourcepub fn with_text(self, text: impl Into<String>) -> Self
pub fn with_text(self, text: impl Into<String>) -> Self
Builder: start with the given text (caret at the start).
Sourcepub fn with_placeholder(self, text: impl Into<SharedString>) -> Self
pub fn with_placeholder(self, text: impl Into<SharedString>) -> Self
Builder: placeholder shown when empty.
Sourcepub fn replace_range(
&mut self,
range: Range<usize>,
text: &str,
cx: &mut Context<'_, Self>,
)
pub fn replace_range( &mut self, range: Range<usize>, text: &str, cx: &mut Context<'_, Self>, )
Replace byte range with text as ONE recorded (undoable) edit, leaving the caret
after the inserted text. Unlike Self::set_text this preserves — and extends — the
undo history, so a host writing back a structural edit (e.g. a committed $$…$$
formula) lands as a normal undo step rather than clobbering the history.
Sourcepub fn set_text(&mut self, text: impl Into<String>, cx: &mut Context<'_, Self>)
pub fn set_text(&mut self, text: impl Into<String>, cx: &mut Context<'_, Self>)
Replace the whole document; resets the caret to the start.
Sourcepub fn set_diagnostics(
&mut self,
diagnostics: Vec<Diagnostic>,
cx: &mut Context<'_, Self>,
)
pub fn set_diagnostics( &mut self, diagnostics: Vec<Diagnostic>, cx: &mut Context<'_, Self>, )
Replace the set of diagnostics (underlined spans). The host computes these (e.g. spell-check) and refreshes them as the text changes.
Sourcepub fn set_code_languages(&mut self, langs: Vec<SharedString>)
pub fn set_code_languages(&mut self, langs: Vec<SharedString>)
Turn on WYSIWYG (live-preview) markdown styling with the given color/font palette (call once at setup). Inline bold/italic/code/link/ tag formatting then renders as you type — markers stay in the text, dimmed. Without it the editor is the raw view: plain text, spell-check underlines only. Languages offered in a code block’s language picker (the host’s highlighter set, e.g. its compiled tree-sitter grammars). Empty — the default — leaves the tag click-inert.
Sourcepub fn set_scroll_compensator(
&mut self,
f: impl Fn(Pixels, &mut Window, &mut App) + 'static,
)
pub fn set_scroll_compensator( &mut self, f: impl Fn(Pixels, &mut Window, &mut App) + 'static, )
Install the scroll-anchoring hook (see ScrollCompensatorFn): when
an async block render (math/mermaid/image) changes heights above the
window viewport, the host receives the delta and shifts its scroll
offset so the visible content stays put (Cditor’s anchor-restore).
pub fn set_markdown_style( &mut self, style: SyntaxStyle, cx: &mut Context<'_, Self>, )
Sourcepub fn set_labels(&mut self, labels: Labels, cx: &mut Context<'_, Self>)
pub fn set_labels(&mut self, labels: Labels, cx: &mut Context<'_, Self>)
Set the host-localized labels for the context menus / chrome. Replace on every language switch so the current editors pick it up.
Sourcepub fn clear_markdown_style(&mut self, cx: &mut Context<'_, Self>)
pub fn clear_markdown_style(&mut self, cx: &mut Context<'_, Self>)
Turn off live-preview styling — the editor falls back to plain text (spell-check underlines only). Used when the host’s WYSIWYG setting is switched off; a no-op if styling was already off.
Sourcepub fn on_suggest(&mut self, provider: impl Fn(&str) -> Vec<String> + 'static)
pub fn on_suggest(&mut self, provider: impl Fn(&str) -> Vec<String> + 'static)
Install the provider consulted when the user right-clicks a flagged word. It’s handed the offending word and returns replacements (best first). Kept lazy by design — the OS suggestion call can be slow, so it runs only on right-click, never in the per-edit detection pass.
Sourcepub fn set_block_image_provider(
&mut self,
provider: impl Fn(&str) -> Option<Arc<RenderImage>> + 'static,
)
pub fn set_block_image_provider( &mut self, provider: impl Fn(&str) -> Option<Arc<RenderImage>> + 'static, )
Install the provider that resolves a standalone image line’s src to a
decoded image; with it, such lines render inline (W4) when the caret is
elsewhere. Without it (or while an image is still loading), the line shows
its raw  source.
Sourcepub fn set_block_chip_provider(
&mut self,
provider: impl Fn(&str) -> Option<SharedString> + 'static,
)
pub fn set_block_chip_provider( &mut self, provider: impl Fn(&str) -> Option<SharedString> + 'static, )
Install the provider that classifies an  reference as a file chip
(e.g. a PDF) and supplies its label. With it, such lines render as a
clickable chip when the caret is elsewhere; a left-click emits
EditorEvent::OpenLink and a right-click places the caret to edit.
Sourcepub fn set_embed_provider(
&mut self,
provider: impl Fn(&str) -> Option<(AnyView, Pixels)> + 'static,
)
pub fn set_embed_provider( &mut self, provider: impl Fn(&str) -> Option<(AnyView, Pixels)> + 'static, )
Install the provider that resolves a standalone ![[target]] line to a
host view rendering the transclusion + the height to reserve for it.
With it, such lines show the embedded content in place (raw on caret);
without (or when it returns None) they fall back to a clickable chip.
Sourcepub fn set_block_mermaid_provider(
&mut self,
provider: impl Fn(&str) -> Option<(Arc<RenderImage>, f32, f32)> + 'static,
)
pub fn set_block_mermaid_provider( &mut self, provider: impl Fn(&str) -> Option<(Arc<RenderImage>, f32, f32)> + 'static, )
Install the provider that resolves a ```mermaid block’s source to a
rendered diagram: the bitmap plus its logical (display) px size — see
[BlockMathFn] for why the host supplies the size. With it, such a block
renders as the diagram when the caret is elsewhere; with the caret inside
(or while it renders) it shows the raw fenced source. Pre-render with
mermaid_sources.
Sourcepub fn set_clipboard_writer(&mut self, writer: ClipboardWriter)
pub fn set_clipboard_writer(&mut self, writer: ClipboardWriter)
Install the provider that resolves a $$…$$ block’s LaTeX to a typeset
equation: the bitmap plus its logical (display) px size — see
[BlockMathFn] for why the host supplies the size. With it, such a block
renders as the equation when the caret is elsewhere; with the caret inside
(or while it renders) it shows the raw $$…$$ source. Pre-render with
math_sources.
Route Copy/Cut through writer instead of gpui’s plain-string copy —
the host owns the actual clipboard write (and its extra flavors).
Sourcepub fn set_search(
&mut self,
matches: Vec<Range<usize>>,
active: Option<usize>,
cx: &mut Context<'_, Self>,
)
pub fn set_search( &mut self, matches: Vec<Range<usize>>, active: Option<usize>, cx: &mut Context<'_, Self>, )
Highlight matches (source byte ranges) behind the text — soft yellow,
with active in the stronger current-match orange (the reader’s
browser-style find colors). Empty clears. Host-driven: a find bar
computes matches (see find_in_source) and steps active.
Sourcepub fn offset_screen_top(&self, offset: usize) -> Option<Pixels>
pub fn offset_screen_top(&self, offset: usize) -> Option<Pixels>
The window-space top of the row containing byte offset (from the
last layout) — for a host scrolling a find match into view. None
before first paint or for an out-of-range offset.
pub fn set_block_math_provider( &mut self, provider: impl Fn(&str) -> Option<(Arc<RenderImage>, f32, f32)> + 'static, )
Sourcepub fn set_block_math_em(&mut self, em: f32)
pub fn set_block_math_em(&mut self, em: f32)
Declare the em the block_math provider rasterizes at (e.g. the host’s display-math
font size). Turns on inline $…$ rendering: each inline formula reuses the block
raster for the same LaTeX, scaled by text_em / em so it sits at text size. Pre-render
inline sources too (see inline_math_sources).
Sourcepub fn set_code_highlighter(
&mut self,
f: impl Fn(&str, &str) -> Vec<(Range<usize>, HighlightStyle)> + 'static,
)
pub fn set_code_highlighter( &mut self, f: impl Fn(&str, &str) -> Vec<(Range<usize>, HighlightStyle)> + 'static, )
Set the fenced-code syntax highlighter (see [CodeHighlightFn]).
Sourcepub fn take_replaced_selection(&mut self) -> Option<String>
pub fn take_replaced_selection(&mut self) -> Option<String>
The text the most recent keystroke edit replaced (its selection), if any — consumed (one read per edit). Lets a host’s auto-pair logic tell “opener typed over a selection” from deletions with identical diffs.
Sourcepub fn set_auto_replace(
&mut self,
f: impl Fn(&str) -> Option<(Range<usize>, String)> + 'static,
)
pub fn set_auto_replace( &mut self, f: impl Fn(&str) -> Option<(Range<usize>, String)> + 'static, )
Set the word-completion auto-replace hook (see [AutoReplaceFn]).
Sourcepub fn set_editing_block(
&mut self,
range: Range<usize>,
view: AnyView,
height: Pixels,
cx: &mut Context<'_, Self>,
)
pub fn set_editing_block( &mut self, range: Range<usize>, view: AnyView, height: Pixels, cx: &mut Context<'_, Self>, )
Begin an in-line structural edit of the $$…$$ block at range: reserve a gap at
its spot and paint view (the host’s editor) there. The host focuses view.
Sourcepub fn editing_block_range(&self) -> Option<Range<usize>>
pub fn editing_block_range(&self) -> Option<Range<usize>>
The byte range of the block currently being structurally edited (the range handed
to Self::set_editing_block — the source text is untouched while the edit is
open, so it stays valid). None when no block edit is open.
Sourcepub fn end_editing_block(
&mut self,
cx: &mut Context<'_, Self>,
) -> Option<Range<usize>>
pub fn end_editing_block( &mut self, cx: &mut Context<'_, Self>, ) -> Option<Range<usize>>
End an in-line math edit (the host has committed / cancelled). Returns the block’s byte range, so the host can overwrite it.
Sourcepub fn set_editing_inline(
&mut self,
range: Range<usize>,
view: AnyView,
offset: Point<Pixels>,
cx: &mut Context<'_, Self>,
)
pub fn set_editing_inline( &mut self, range: Range<usize>, view: AnyView, offset: Point<Pixels>, cx: &mut Context<'_, Self>, )
Begin a structural edit of the inline $…$ span at range (absolute bytes): overlay
view (the host’s editor) at the formula’s painted spot. The host focuses view.
offset places the view relative to the raster’s top-left, letting the host
align the view’s glyphs with the displayed formula’s (their paddings differ).
Sourcepub fn end_editing_inline(
&mut self,
cx: &mut Context<'_, Self>,
) -> Option<Range<usize>>
pub fn end_editing_inline( &mut self, cx: &mut Context<'_, Self>, ) -> Option<Range<usize>>
End an inline math edit. Returns the span’s byte range, so the host can overwrite it.
Sourcepub fn is_inline_math_range(&self, range: &Range<usize>) -> bool
pub fn is_inline_math_range(&self, range: &Range<usize>) -> bool
Whether range still bounds an inline $…$ span (a $ at each end, content between, no
newline, not a $$ fence) — guards the inline commit against a stale/shifted range that
would otherwise splice text at the wrong spot.
Sourcepub fn math_align(&self, block_start: usize) -> MathAlign
pub fn math_align(&self, block_start: usize) -> MathAlign
The horizontal alignment of the $$…$$ block whose byte range starts at block_start
(its <!-- math:ALIGN --> marker, or Center by default) — so the host can seed the
in-line editor at the right justification when opening it.
Sourcepub fn math_marker_edit(
&self,
block: Range<usize>,
align: MathAlign,
) -> (Range<usize>, String)
pub fn math_marker_edit( &self, block: Range<usize>, align: MathAlign, ) -> (Range<usize>, String)
Compute the recorded edit that writes align’s marker for the $$ block at byte
block: the (possibly marker-extended) range to replace, and the marker prefix to
prepend to the rewritten block. Center (default) → no marker (drops any existing one);
left/right → add or replace it. The host appends the block text to the prefix. Folding
the marker into the block’s commit edit avoids a separate, range-shifting edit.
Sourcepub fn find_math_block(
&self,
source: &str,
approx: usize,
) -> Option<Range<usize>>
pub fn find_math_block( &self, source: &str, approx: usize, ) -> Option<Range<usize>>
Re-find a $$…$$ block by its exact LaTeX source, returned as a BYTE range (nearest
to the now-stale byte approx if several match) — so opening/committing one after a
prior formula’s commit shifted offsets targets the right block. math_blocks yields
LINE ranges, so convert like math_block_at does (else the caret jumps to the top).
Sourcepub fn find_inline_math(
&self,
latex: &str,
approx: usize,
) -> Option<Range<usize>>
pub fn find_inline_math( &self, latex: &str, approx: usize, ) -> Option<Range<usize>>
Re-find an inline $…$ span by its exact inner LaTeX, as an absolute byte range (nearest
to the now-stale byte approx if several match) — the inline counterpart of
Self::find_math_block, so opening/committing after a prior edit shifted offsets
targets the right span.
Sourcepub fn is_math_block_range(&self, range: &Range<usize>) -> bool
pub fn is_math_block_range(&self, range: &Range<usize>) -> bool
Whether byte range (half-open) still starts a $$…$$ block — a commit guard so a
stale/shifted range can’t splice the block into the wrong place and corrupt the doc.
Sourcepub fn set_tab_indent(&mut self, spaces: usize)
pub fn set_tab_indent(&mut self, spaces: usize)
Spaces inserted per Tab / list-nesting level (Indent/Outdent). The host
keeps this in sync with its list-indent setting so nesting is configurable.
Sourcepub fn cursor(&self) -> usize
pub fn cursor(&self) -> usize
The caret’s byte offset into Self::text (the moving end of any
selection). For hosts that drive a menu/completion off the caret position.
Sourcepub fn last_edit_was_keystroke(&self) -> bool
pub fn last_edit_was_keystroke(&self) -> bool
Whether the last content change was a single typed character or single-char backspace (vs a programmatic / multi-char edit). Hosts gate auto-pairing on this so structural edits (table row/column ops, paste, …) don’t trip it.
Sourcepub fn set_cursor(&mut self, offset: usize, cx: &mut Context<'_, Self>)
pub fn set_cursor(&mut self, offset: usize, cx: &mut Context<'_, Self>)
Place the caret at offset (a byte offset into the document), collapsing
any selection. Clamped to the document and snapped down to a char
boundary, so a host can pass a raw click offset safely — e.g. to enter
edit mode where rendered text was clicked.
Sourcepub fn row_layout(&self) -> Vec<(Pixels, Pixels)>
pub fn row_layout(&self) -> Vec<(Pixels, Pixels)>
Per logical line, from the last paint: its top offset within the editor and its first wrap-row’s height — enough for a host-drawn gutter (line numbers) to align with rows without re-deriving layout. Empty before the first paint. Rows collapsed by a heading fold show no vertical advance (the next row’s top equals theirs) — a gutter should skip those.
Sourcepub fn bounds_for_offset(&self, offset: usize) -> Option<Bounds<Pixels>>
pub fn bounds_for_offset(&self, offset: usize) -> Option<Bounds<Pixels>>
Window-space bounds of the caret at offset, from the last paint’s
layout — for anchoring a popup (e.g. a slash menu) at a document offset.
None before the first paint or if offset’s row isn’t laid out.
Sourcepub fn value(&self) -> SharedString
pub fn value(&self) -> SharedString
The document text as an owned SharedString; use Self::text for a
borrowed &str.
Sourcepub fn focus(&self, window: &mut Window, cx: &mut Context<'_, Self>)
pub fn focus(&self, window: &mut Window, cx: &mut Context<'_, Self>)
Focus the editor so it receives keyboard input. (set_cursor only moves
the caret; call this to enter edit mode, e.g. on a click into rendered text.)
Sourcepub fn copy_plain(&mut self, _window: &mut Window, cx: &mut Context<'_, Self>)
pub fn copy_plain(&mut self, _window: &mut Window, cx: &mut Context<'_, Self>)
Copy the selection as the raw markdown ONLY — no host clipboard
flavors — for pasting literal source into rich surfaces (the context
menu’s “Copy as Markdown”). Same selection/renumber rules as copy.
Sourcepub fn edit_math_at_caret(&mut self, cx: &mut Context<'_, Self>)
pub fn edit_math_at_caret(&mut self, cx: &mut Context<'_, Self>)
If the caret sits inside a $$…$$ block, ask the host to open the structural editor
for it (caret at the formula’s start). Lets the host turn a freshly-inserted, empty
math block (the /math snippet) straight into a live editor instead of raw source.
Sourcepub fn property_block_at_caret(&self) -> Option<(Range<usize>, SharedString)>
pub fn property_block_at_caret(&self) -> Option<(Range<usize>, SharedString)>
The property block covering the caret’s line, if any (WYSIWYG-only, like
Self::edit_math_at_caret) — so the host can open the property editor
on a freshly-inserted /property line instead of leaving raw source.
Sourcepub fn set_grip_inset(&mut self, inset: Pixels)
pub fn set_grip_inset(&mut self, inset: Pixels)
Extra left offset for the gutter drag grip (e.g. the host’s line-number gutter width), so the grip clears other gutter chrome.
Sourcepub fn exit_math(
&mut self,
block: Range<usize>,
after: bool,
window: &mut Window,
cx: &mut Context<'_, Self>,
)
pub fn exit_math( &mut self, block: Range<usize>, after: bool, window: &mut Window, cx: &mut Context<'_, Self>, )
Seat the caret on the plain-text line just before (after = false) or after
(after = true) the math block, and focus the editor — the keyboard counterpart to
clicking away, for when the caret flows out of a $$…$$ formula’s structural editor
(so it never lands on the hidden $$ fence lines, which would reveal raw source).
Sourcepub fn caret_screen_bounds(&self) -> Option<Bounds<Pixels>>
pub fn caret_screen_bounds(&self) -> Option<Bounds<Pixels>>
The caret’s bounds in window space (its painted Y range), or None before
the first paint. Lets a host scroll the caret into view; computed from the
layout stored at the last paint, so it’s valid for caret moves that don’t
change the text (arrow keys, click).
Trait Implementations§
Source§impl EntityInputHandler for EditorState
impl EntityInputHandler for EditorState
Source§fn text_for_range(
&mut self,
range_utf16: Range<usize>,
actual_range: &mut Option<Range<usize>>,
_: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<String>
fn text_for_range( &mut self, range_utf16: Range<usize>, actual_range: &mut Option<Range<usize>>, _: &mut Window, _: &mut Context<'_, Self>, ) -> Option<String>
InputHandler::text_for_range for detailsSource§fn selected_text_range(
&mut self,
_: bool,
_: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<UTF16Selection>
fn selected_text_range( &mut self, _: bool, _: &mut Window, _: &mut Context<'_, Self>, ) -> Option<UTF16Selection>
InputHandler::selected_text_range for detailsSource§fn marked_text_range(
&self,
_: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<Range<usize>>
fn marked_text_range( &self, _: &mut Window, _: &mut Context<'_, Self>, ) -> Option<Range<usize>>
InputHandler::marked_text_range for detailsSource§fn unmark_text(&mut self, _: &mut Window, _: &mut Context<'_, Self>)
fn unmark_text(&mut self, _: &mut Window, _: &mut Context<'_, Self>)
InputHandler::unmark_text for detailsSource§fn replace_text_in_range(
&mut self,
range_utf16: Option<Range<usize>>,
new_text: &str,
_: &mut Window,
cx: &mut Context<'_, Self>,
)
fn replace_text_in_range( &mut self, range_utf16: Option<Range<usize>>, new_text: &str, _: &mut Window, cx: &mut Context<'_, Self>, )
InputHandler::replace_text_in_range for detailsSource§fn replace_and_mark_text_in_range(
&mut self,
range_utf16: Option<Range<usize>>,
new_text: &str,
new_selected_range_utf16: Option<Range<usize>>,
_: &mut Window,
cx: &mut Context<'_, Self>,
)
fn replace_and_mark_text_in_range( &mut self, range_utf16: Option<Range<usize>>, new_text: &str, new_selected_range_utf16: Option<Range<usize>>, _: &mut Window, cx: &mut Context<'_, Self>, )
InputHandler::replace_and_mark_text_in_range for detailsSource§fn bounds_for_range(
&mut self,
range_utf16: Range<usize>,
bounds: Bounds<Pixels>,
_: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<Bounds<Pixels>>
fn bounds_for_range( &mut self, range_utf16: Range<usize>, bounds: Bounds<Pixels>, _: &mut Window, _: &mut Context<'_, Self>, ) -> Option<Bounds<Pixels>>
InputHandler::bounds_for_range for detailsSource§fn character_index_for_point(
&mut self,
point: Point<Pixels>,
_: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<usize>
fn character_index_for_point( &mut self, point: Point<Pixels>, _: &mut Window, _: &mut Context<'_, Self>, ) -> Option<usize>
InputHandler::character_index_for_point for detailsSource§fn paste(
&mut self,
item: ClipboardItem,
window: &mut Window,
cx: &mut Context<'_, Self>,
)
fn paste( &mut self, item: ClipboardItem, window: &mut Window, cx: &mut Context<'_, Self>, )
InputHandler::paste for detailsSource§fn set_selected_text_range(
&mut self,
_range_utf16: Range<usize>,
_window: &mut Window,
_cx: &mut Context<'_, Self>,
)
fn set_selected_text_range( &mut self, _range_utf16: Range<usize>, _window: &mut Window, _cx: &mut Context<'_, Self>, )
InputHandler::set_selected_text_range for detailsSource§fn text_length_utf16(
&mut self,
_window: &mut Window,
_cx: &mut Context<'_, Self>,
) -> Option<usize>
fn text_length_utf16( &mut self, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> Option<usize>
InputHandler::text_length_utf16 for detailsSource§fn accepts_text_input(
&self,
_window: &mut Window,
_cx: &mut Context<'_, Self>,
) -> bool
fn accepts_text_input( &self, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> bool
InputHandler::accepts_text_input for detailsSource§fn text_input_configuration(
&mut self,
_window: &mut Window,
_cx: &mut Context<'_, Self>,
) -> TextInputConfiguration
fn text_input_configuration( &mut self, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> TextInputConfiguration
InputHandler::text_input_configuration for detailsSource§fn text_input_editable_range(
&mut self,
_window: &mut Window,
_cx: &mut Context<'_, Self>,
) -> Option<Range<usize>>
fn text_input_editable_range( &mut self, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> Option<Range<usize>>
InputHandler::text_input_editable_range for detailsimpl EventEmitter<EditorEvent> for EditorState
Source§impl Focusable for EditorState
impl Focusable for EditorState
Source§fn focus_handle(&self, _: &App) -> FocusHandle
fn focus_handle(&self, _: &App) -> FocusHandle
Source§impl Render for EditorState
impl Render for EditorState
Auto Trait Implementations§
impl !Freeze for EditorState
impl !RefUnwindSafe for EditorState
impl !Send for EditorState
impl !Sync for EditorState
impl !UnwindSafe for EditorState
impl Unpin for EditorState
impl UnsafeUnpin for EditorState
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> 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 more