Crate editor_types

Crate editor_types 

Source
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§

action
A macro that turns a shorthand command DSL into an Action.

Enums§

Action
The result of either pressing a complete keybinding sequence, or parsing a command.
CommandAction
Actions for running application commands (e.g. :w or :quit).
CommandBarAction
Actions for manipulating the application’s command bar.
CursorAction
Actions for manipulating cursor groups.
EditAction
The various actions that can be taken on text.
EditorAction
Actions for editing text within buffer.
HistoryAction
Actions for manipulating a buffer’s history.
InsertTextAction
Actions for inserting text into a buffer.
MacroAction
Actions for recording and running macros.
PromptAction
Actions for manipulating prompts.
SelectionAction
Actions for manipulating text selections.
TabAction
Actions for manipulating application tabs.
WindowAction
Actions for manipulating application windows.