Expand description
§Editor Actions
§Overview
The types in this module provides a defunctionalized view of a text editor. Consumers of these types should map them into text manipulation or user interface actions.
The traits contained here can be implemented to indicate that an object is capable of processing the associated action.
§Examples
use modalkit::actions::{Action, EditAction, EditorAction};
use modalkit::prelude::*;
// Delete the current text selection.
let _: Action = EditorAction::Edit(EditAction::Delete.into(), EditTarget::Selection).into();
// Copy the next three lines.
let _: Action = EditorAction::Edit(EditAction::Yank.into(), EditTarget::Range(RangeType::Line, true, 3.into())).into();
// Make some contextually specified number of words lowercase.
let _: Action = EditorAction::Edit(
EditAction::ChangeCase(Case::Lower).into(),
EditTarget::Motion(MoveType::WordBegin(WordStyle::Big, MoveDir1D::Next), Count::Contextual)
).into();
// Scroll the viewport so that line 10 is at the top of the screen.
let _: Action = Action::Scroll(ScrollStyle::LinePos(MovePosition::Beginning, 10.into()));
Enums§
- The result of either pressing a complete keybinding sequence, or parsing a command.
- Command actions
- Command bar actions
- Cursor group actions
- The various actions that can be taken on text.
- Editor manipulation
- Editing history actions
- Text insertion actions
- Macro actions
- Prompt actions
- Selection manipulation
- Tab actions
- Window actions
Traits§
- Trait for objects which can process CommandActions.
- Trait for objects which can process EditorActions.
- An object capable of performing editing operations.
- Trait for objects that can move through a PositionList.
- A widget that the user can switch focus of keyboard input to.
- Trait for objects that can be scrolled.
- Trait for objects that can be searched.
- Trait for objects that contain tabbed content.
- Trait counting tabs withing an object.
- Trait for objects that contain windows.
- Trait for counting windows within an object.