builtin commandline: minor cleanup

This commit is contained in:
Johannes Altmanninger
2025-04-15 11:44:39 +02:00
parent 0284292392
commit 4e85366416

View File

@@ -730,22 +730,16 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr])
current_cursor_pos,
streams,
);
} else if positional_args == 1 {
replace_part(
parser,
range,
args[w.wopt_index],
append_mode,
current_buffer,
current_cursor_pos,
search_field_mode,
);
} else {
let sb = join_strings(&w.argv[w.wopt_index..], '\n');
let replacement = if positional_args == 1 {
Cow::Borrowed(args[w.wopt_index])
} else {
Cow::Owned(join_strings(&w.argv[w.wopt_index..], '\n'))
};
replace_part(
parser,
range,
&sb,
&replacement,
append_mode,
current_buffer,
current_cursor_pos,