pub enum ViewCommand {
SetViewportWidth {
width: usize,
},
SetWrapMode {
mode: WrapMode,
},
SetWrapIndent {
indent: WrapIndent,
},
SetTabWidth {
width: usize,
},
SetTabKeyBehavior {
behavior: TabKeyBehavior,
},
SetIndentationConfig {
config: IndentationConfig,
},
SetAutoPairsConfig {
config: AutoPairsConfig,
},
SetAutoPairsEnabled {
enabled: bool,
},
SetWordBoundaryAsciiBoundaryChars {
boundary_chars: String,
},
ResetWordBoundaryDefaults,
ScrollTo {
line: usize,
},
GetViewport {
start_row: usize,
count: usize,
},
}Expand description
View commands
Variants§
SetViewportWidth
Set viewport width
SetWrapMode
Set soft wrap mode.
SetWrapIndent
Set wrapped-line indentation policy.
Fields
indent: WrapIndentWrap indent policy.
SetTabWidth
Set tab width (in character cells) used for measuring '\t' and tab stops.
SetTabKeyBehavior
Configure how EditCommand::InsertTab inserts text.
Fields
behavior: TabKeyBehaviorTab key behavior.
SetIndentationConfig
Configure language-aware auto-indentation behavior used by EditCommand::InsertNewline
when auto_indent=true.
Notes:
- This is view-local (each view can have different indentation rules).
Fields
config: IndentationConfigIndentation configuration.
SetAutoPairsConfig
Configure auto-pairs behavior used by EditCommand::TypeChar.
Fields
config: AutoPairsConfigAuto-pairs config.
SetAutoPairsEnabled
Enable/disable auto-pairs behavior (convenience wrapper over ViewCommand::SetAutoPairsConfig).
SetWordBoundaryAsciiBoundaryChars
Override the ASCII word-boundary character set used by editor-friendly “word” operations.
This is similar in spirit to VSCode’s wordSeparators.
Notes:
- Only ASCII characters are configurable here; non-ASCII characters are always treated as boundaries.
- ASCII whitespace is always treated as a boundary.
ResetWordBoundaryDefaults
Reset word-boundary configuration to the default (ASCII identifier-like words).
ScrollTo
Scroll to specified line
GetViewport
Get current viewport content
Trait Implementations§
Source§impl Clone for ViewCommand
impl Clone for ViewCommand
Source§fn clone(&self) -> ViewCommand
fn clone(&self) -> ViewCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ViewCommand
impl Debug for ViewCommand
impl Eq for ViewCommand
Source§impl PartialEq for ViewCommand
impl PartialEq for ViewCommand
Source§fn eq(&self, other: &ViewCommand) -> bool
fn eq(&self, other: &ViewCommand) -> bool
self and other values to be equal, and is used by ==.