pub struct InputRules;Expand description
Markdown input rules — auto-behaviors triggered by specific keystrokes.
These are called by the view layer when the user presses Enter, Tab, etc. They inspect the current context and apply markdown-aware transformations.
Implementations§
Source§impl InputRules
impl InputRules
Sourcepub fn handle_enter(editor: &mut Editor) -> bool
pub fn handle_enter(editor: &mut Editor) -> bool
Handle Enter key press. Returns true if a rule was applied.
Rules:
- In a list item: continue the list with a new item
- In an empty list item: exit the list (remove the marker)
- In a blockquote: continue the quote
- In a fenced code block: just insert newline (no special behavior)
Sourcepub fn handle_tab(editor: &mut Editor) -> bool
pub fn handle_tab(editor: &mut Editor) -> bool
Handle Tab key press. Returns true if a rule was applied.
Rules:
- In a list item: increase indent level
Sourcepub fn handle_shift_tab(editor: &mut Editor) -> bool
pub fn handle_shift_tab(editor: &mut Editor) -> bool
Handle Shift+Tab key press. Returns true if a rule was applied.
Rules:
- In an indented list item: decrease indent level
Sourcepub fn handle_backspace_at_prefix(editor: &mut Editor) -> bool
pub fn handle_backspace_at_prefix(editor: &mut Editor) -> bool
Handle Backspace at the start of a list item or blockquote. Returns true if a rule was applied.
Auto Trait Implementations§
impl Freeze for InputRules
impl RefUnwindSafe for InputRules
impl Send for InputRules
impl Sync for InputRules
impl Unpin for InputRules
impl UnsafeUnpin for InputRules
impl UnwindSafe for InputRules
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