pub struct AutoPairsHook;Expand description
Built-in hook that automatically inserts closing quotes, brackets, and braces, wraps selected text, and steps over closing pairs.
Implementations§
Source§impl AutoPairsHook
impl AutoPairsHook
Trait Implementations§
Source§impl Clone for AutoPairsHook
impl Clone for AutoPairsHook
Source§fn clone(&self) -> AutoPairsHook
fn clone(&self) -> AutoPairsHook
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AutoPairsHook
impl Debug for AutoPairsHook
Source§impl Default for AutoPairsHook
impl Default for AutoPairsHook
Source§fn default() -> AutoPairsHook
fn default() -> AutoPairsHook
Returns the “default value” for a type. Read more
Source§impl EditorHook for AutoPairsHook
impl EditorHook for AutoPairsHook
Source§fn on_key(&mut self, ctx: &mut HookContext<'_>, event: &KeyEvent) -> HookOutcome
fn on_key(&mut self, ctx: &mut HookContext<'_>, event: &KeyEvent) -> HookOutcome
Intercepts a key press before standard editor processing.
Source§fn on_search_action(
&mut self,
_ctx: &mut HookContext<'_>,
_action: SearchAction,
) -> HookOutcome
fn on_search_action( &mut self, _ctx: &mut HookContext<'_>, _action: SearchAction, ) -> HookOutcome
Handles a synthetic search-panel action (prompt-bar clicks). Read more
Source§fn before_insert(
&mut self,
_ctx: &mut HookContext<'_>,
_text: char,
) -> HookOutcome
fn before_insert( &mut self, _ctx: &mut HookContext<'_>, _text: char, ) -> HookOutcome
Intercepts text insertion before it is written to the buffer.
Source§fn after_edit(&mut self, _buffer: &mut EditorBuffer)
fn after_edit(&mut self, _buffer: &mut EditorBuffer)
Called immediately after any buffer mutation (typing, deletions, paste, undo/redo).
Source§fn on_selection_change(
&mut self,
_buffer: &EditorBuffer,
_selection: Option<&Selection>,
)
fn on_selection_change( &mut self, _buffer: &EditorBuffer, _selection: Option<&Selection>, )
Called whenever the cursor offset or selection range changes.
Source§fn on_click(
&mut self,
_ctx: &mut HookContext<'_>,
_row: usize,
_col: usize,
) -> HookOutcome
fn on_click( &mut self, _ctx: &mut HookContext<'_>, _row: usize, _col: usize, ) -> HookOutcome
Intercepts a mouse click at a given buffer line and source byte column. Read more
Contributes right-click context menu rows for the given click. Read more
Handles activation of a context menu row by
id. Read moreSource§fn status_text(&self) -> Option<&str>
fn status_text(&self) -> Option<&str>
Returns a human-readable status or active mode name, if any.
Source§fn search_snapshot(&self) -> Option<SearchSnapshot>
fn search_snapshot(&self) -> Option<SearchSnapshot>
Returns a live search-panel snapshot for renderers (toggles, matches). Read more
Auto Trait Implementations§
impl Freeze for AutoPairsHook
impl RefUnwindSafe for AutoPairsHook
impl Send for AutoPairsHook
impl Sync for AutoPairsHook
impl Unpin for AutoPairsHook
impl UnsafeUnpin for AutoPairsHook
impl UnwindSafe for AutoPairsHook
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
Mutably borrows from an owned value. Read more