|
|
@ -3147,7 +3147,16 @@ fn command_mode(cx: &mut Context) {
|
|
|
|
|
|
|
|
|
|
|
|
// Handle typable commands
|
|
|
|
// Handle typable commands
|
|
|
|
if let Some(cmd) = cmd::TYPABLE_COMMAND_MAP.get(parts[0]) {
|
|
|
|
if let Some(cmd) = cmd::TYPABLE_COMMAND_MAP.get(parts[0]) {
|
|
|
|
let args = shellwords::shellwords(input);
|
|
|
|
let args = if cfg!(unix) {
|
|
|
|
|
|
|
|
shellwords::shellwords(input)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// Windows doesn't support POSIX, so fallback for now
|
|
|
|
|
|
|
|
parts
|
|
|
|
|
|
|
|
.into_iter()
|
|
|
|
|
|
|
|
.map(|part| part.into())
|
|
|
|
|
|
|
|
.collect::<Vec<_>>()
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if let Err(e) = (cmd.fun)(cx, &args[1..], event) {
|
|
|
|
if let Err(e) = (cmd.fun)(cx, &args[1..], event) {
|
|
|
|
cx.editor.set_error(format!("{}", e));
|
|
|
|
cx.editor.set_error(format!("{}", e));
|
|
|
|
}
|
|
|
|
}
|
|
|
|