pub struct SubstFlags {
pub all: bool,
pub ignore_case: bool,
pub case_sensitive: bool,
pub confirm: bool,
pub report_only: bool,
pub no_error: bool,
pub print: bool,
pub print_num: bool,
pub print_list: bool,
pub reuse_previous: bool,
}Expand description
Flags for the substitute command.
Fields§
§all: boolg — replace all occurrences on each line (default: first only).
ignore_case: booli — case-insensitive (overrides editor ignorecase).
case_sensitive: boolI — case-sensitive (overrides editor ignorecase).
confirm: boolc — confirm mode. When set, apply_substitute skips all matches
and the caller must use collect_substitute_matches +
apply_collected_matches for interactive replacement.
report_only: booln — report the match count only; do not modify the buffer or move
the cursor. apply_substitute counts matches and returns without
mutating.
no_error: boole — do not treat “pattern not found” as an error. hjkl already
returns success on no match, so this is accepted for compatibility.
print: boolp / # / l — print the last changed line (optionally with line
number # or :list-style l). Parsed and accepted; the print
itself is surfaced by the ex/host layer.
print_num: bool# — print with line number (implies print).
print_list: booll — print :list-style (implies print).
reuse_previous: bool& — reuse the flags from the previous substitute (:h :s_flags).
Resolved by the ex handler, which merges the stored last_substitute
flags into this command’s before applying.
Trait Implementations§
Source§impl Clone for SubstFlags
impl Clone for SubstFlags
Source§fn clone(&self) -> SubstFlags
fn clone(&self) -> SubstFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more