pub enum ExEffect {
Show 16 variants
None,
Save,
SaveAs(String),
Quit {
force: bool,
save: bool,
},
Unknown(String),
Substituted {
count: usize,
lines_changed: usize,
},
Ok,
Info(String),
InfoTitled {
title: &'static str,
content: String,
},
Error(String),
EditFile {
path: String,
force: bool,
},
BufferDelete {
force: bool,
wipe: bool,
},
PutRegister {
reg: char,
above: bool,
},
SaveAndRename {
path: String,
},
RenameBuffer {
name: String,
},
Cwd(String),
}Expand description
Describes what the caller should do after an ex command runs.
Variants that mutate editor state (substitute, goto-line, clear-highlight) are applied in-place inside the dispatcher; everything else is returned so the host loop can act on it.
Variants§
None
Nothing happened (empty input or no-op effect).
Save
Save the current buffer to the current filename.
SaveAs(String)
Save to a specific path (:w <path>). The caller updates its
filename field so future :w writes there.
Quit
Quit (:q, :q!, :wq, :x).
Unknown(String)
Unknown command — caller should surface as an error toast.
Substituted
Substitution finished — report replacement count and lines changed.
Ok
A no-op response for successful commands that don’t need a side
effect but should not be reported as unknown (e.g. :noh).
Info(String)
Surface an informational message (single-line or unclassified multi-line).
InfoTitled
Surface a titled multi-line listing (:reg, :marks, :jumps, :changes).
The title is a static label used by the host to open a named info
popup without brittle header-prefix string matching.
Fields
Error(String)
Surface an error message (syntax error, bad pattern, …).
EditFile
:e <path> / :edit <path> — open a different file in the current
window. An empty path means reload the current buffer.
BufferDelete
:bd[!] / :bw[!] — close the current buffer.
wipe = true for :bwipeout; force = true when ! was given.
PutRegister
:put [{reg}] / :pu [{reg}] — paste register contents as a new
line below (or above when above = true) the cursor.
SaveAndRename
:saveas {path} / :sav {path} — write buffer to path AND rename
the buffer identity so future :w writes there.
Distinct from SaveAs (:w <path>) which writes elsewhere but keeps
the buffer’s own filename unchanged.
RenameBuffer
:file {name} — rename the current buffer in-memory without writing.
Cwd(String)
:cd [{path}] — change the working directory. An empty path means
$HOME. The directory change is applied inside the handler; the new
path is surfaced so the host can update its status-line / title.