Trait modalkit::actions::EditorActions
source · pub trait EditorActions<C, S, I>where
I: ApplicationInfo,{
// Required methods
fn edit(
&mut self,
action: &EditAction,
target: &EditTarget,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>;
fn mark(
&mut self,
name: Mark,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>;
fn complete(
&mut self,
comptype: &CompletionType,
selection: &CompletionSelection,
display: &CompletionDisplay,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>;
fn insert_text(
&mut self,
act: &InsertTextAction,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>;
fn selection_command(
&mut self,
act: &SelectionAction,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>;
fn cursor_command(
&mut self,
act: &CursorAction,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>;
fn history_command(
&mut self,
act: &HistoryAction,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>;
}
Expand description
An object capable of performing editing operations.
Required Methods§
sourcefn edit(
&mut self,
action: &EditAction,
target: &EditTarget,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>
fn edit( &mut self, action: &EditAction, target: &EditTarget, ctx: &C, store: &mut S, ) -> EditResult<EditInfo, I>
Perform an editing operation over the targeted text.
sourcefn mark(
&mut self,
name: Mark,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>
fn mark( &mut self, name: Mark, ctx: &C, store: &mut S, ) -> EditResult<EditInfo, I>
Create or update a cursor mark based on the leader’s cursor position.
sourcefn complete(
&mut self,
comptype: &CompletionType,
selection: &CompletionSelection,
display: &CompletionDisplay,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>
fn complete( &mut self, comptype: &CompletionType, selection: &CompletionSelection, display: &CompletionDisplay, ctx: &C, store: &mut S, ) -> EditResult<EditInfo, I>
Complete the text before the cursor group leader.
sourcefn insert_text(
&mut self,
act: &InsertTextAction,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>
fn insert_text( &mut self, act: &InsertTextAction, ctx: &C, store: &mut S, ) -> EditResult<EditInfo, I>
Insert text relative to the current cursor position.
sourcefn selection_command(
&mut self,
act: &SelectionAction,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>
fn selection_command( &mut self, act: &SelectionAction, ctx: &C, store: &mut S, ) -> EditResult<EditInfo, I>
Modify the current selection.
sourcefn cursor_command(
&mut self,
act: &CursorAction,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>
fn cursor_command( &mut self, act: &CursorAction, ctx: &C, store: &mut S, ) -> EditResult<EditInfo, I>
Perform an action over a cursor group.
sourcefn history_command(
&mut self,
act: &HistoryAction,
ctx: &C,
store: &mut S,
) -> EditResult<EditInfo, I>
fn history_command( &mut self, act: &HistoryAction, ctx: &C, store: &mut S, ) -> EditResult<EditInfo, I>
Move to a different point in the buffer’s editing history.