pub enum Mark {
BufferLastExited,
BufferNamed(char),
GlobalLastExited(usize),
GlobalNamed(char),
LastChanged,
LastInserted,
LastJump,
VisualBegin,
VisualEnd,
LastYankedBegin,
LastYankedEnd,
}Expand description
Saved cursor positions.
Variants§
BufferLastExited
The position of the cursor in the current buffer when it last exited.
For example, '" in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact buffer-last-exited)");
let exp: Action = EditorAction::Mark(Mark::BufferLastExited.into()).into();
assert_eq!(act, exp);BufferNamed(char)
A user-named position in the current buffer.
For example, '[a-z] in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact buffer-named 'c')");
let exp: Action = EditorAction::Mark(Mark::BufferNamed('c').into()).into();
assert_eq!(act, exp);GlobalLastExited(usize)
The position of the current when the application was previously exited.
Index 0 is the cursor position the last time the application exited, 1 the position the second most recent exit, and so on.
For example, '[0-9] in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact global-last-exited 1)");
let exp: Action = EditorAction::Mark(Mark::GlobalLastExited(1).into()).into();
assert_eq!(act, exp);GlobalNamed(char)
A global, user-named position in some buffer known to the application.
For example, '[A-Z] in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact global-named 'C')");
let exp: Action = EditorAction::Mark(Mark::GlobalNamed('C').into()).into();
assert_eq!(act, exp);LastChanged
The cursor position where the last change was made.
For example, '. in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact last-changed)");
let exp: Action = EditorAction::Mark(Mark::LastChanged.into()).into();
assert_eq!(act, exp);LastInserted
The cursor position where the last text was inserted.
For example, '^ in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact last-inserted)");
let exp: Action = EditorAction::Mark(Mark::LastInserted.into()).into();
assert_eq!(act, exp);LastJump
The cursor position before the latest jump.
For example, '' and '` in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact last-jump)");
let exp: Action = EditorAction::Mark(Mark::LastJump.into()).into();
assert_eq!(act, exp);VisualBegin
The position of the beginning of the last text selection.
For example, '< in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact visual-begin)");
let exp: Action = EditorAction::Mark(Mark::VisualBegin.into()).into();
assert_eq!(act, exp);VisualEnd
The position of the end of the last text selection.
For example, '> in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact visual-end)");
let exp: Action = EditorAction::Mark(Mark::VisualEnd.into()).into();
assert_eq!(act, exp);LastYankedBegin
The position of the beginning of the last yanked text.
For example, '[ in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact last-yanked-begin)");
let exp: Action = EditorAction::Mark(Mark::LastYankedBegin.into()).into();
assert_eq!(act, exp);LastYankedEnd
The position of the end of the last yanked text.
For example, '] in Vim.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, EditorAction};
let act: Action = action!("mark -m (exact last-yanked-end)");
let exp: Action = EditorAction::Mark(Mark::LastYankedEnd.into()).into();
assert_eq!(act, exp);