Expand description
§Editor Types
§Overview
The types in this crate provides a defunctionalized view of a text editor. Consumers of these types should map them into text manipulation or user interface actions.
§Examples
use editor_types::{Action, EditAction, EditorAction};
use editor_types::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()));Modules§
- application
- Application Customization
- context
- Editing Context
- prelude
- Common set of types used for describing actions
Macros§
Enums§
- Action
- The result of either pressing a complete keybinding sequence, or parsing a command.
- Command
Action - Actions for running application commands (e.g.
:wor:quit). - Command
BarAction - Actions for manipulating the application’s command bar.
- Cursor
Action - Actions for manipulating cursor groups.
- Edit
Action - The various actions that can be taken on text.
- Editor
Action - Actions for editing text within buffer.
- History
Action - Actions for manipulating a buffer’s history.
- Insert
Text Action - Actions for inserting text into a buffer.
- Macro
Action - Actions for recording and running macros.
- Prompt
Action - Actions for manipulating prompts.
- Selection
Action - Actions for manipulating text selections.
- TabAction
- Actions for manipulating application tabs.
- Window
Action - Actions for manipulating application windows.