aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands/typed.rs1
-rw-r--r--helix-term/src/ui/prompt.rs6
2 files changed, 2 insertions, 5 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index 304b30f9..36080d39 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -2219,6 +2219,7 @@ pub(super) fn command_mode(cx: &mut Context) {
completer(editor, part)
.into_iter()
.map(|(range, file)| {
+ let file = shellwords::escape(file);
// offset ranges to input
let offset = input.len() - part.len();
let range = (range.start + offset)..;
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index ca2872a7..51ef688d 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -1,6 +1,5 @@
use crate::compositor::{Component, Compositor, Context, Event, EventResult};
use crate::{alt, ctrl, key, shift, ui};
-use helix_core::shellwords;
use helix_view::input::KeyEvent;
use helix_view::keyboard::KeyCode;
use std::{borrow::Cow, ops::RangeFrom};
@@ -336,10 +335,7 @@ impl Prompt {
let (range, item) = &self.completion[index];
- // since we are using shellwords to parse arguments, make sure
- // that whitespace in files is properly escaped.
- let item = shellwords::escape(item);
- self.line.replace_range(range.clone(), &item);
+ self.line.replace_range(range.clone(), item);
self.move_end();
}