allow reedline ctrl+o to take editor arguments (#544)

* allow reedline ctrl+o to take editor arguments

* clippy
This commit is contained in:
pwygab 2023-02-27 03:05:05 +08:00 committed by GitHub
parent 0082cc39ae
commit ac1d9549a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1348,8 +1348,12 @@ impl Reedline {
write!(file, "{}", self.editor.get_buffer())?;
}
let mut ed = editor.split(' ');
let command = ed.next();
{
let mut process = Command::new(editor);
let mut process = Command::new(command.unwrap_or(editor));
process.args(ed);
process.arg(temp_file.as_path());
let mut child = process.spawn()?;