aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorMichael Davis2022-11-04 01:58:54 +0000
committerBlaž Hrastnik2022-11-07 04:38:16 +0000
commit3d283b2ca43bb077f52c48fec5e4870cd314b4e3 (patch)
treec95f608404ce5da069688eb0ccf9d196cadbcc31 /helix-term/src/commands
parent1536a6528968f38adfac2e991b29006f5ded5968 (diff)
Escape filenames in command completion
This changes the completion items to be rendered with shellword escaping, so a file `a b.txt` is rendered as `a\ b.txt` which matches how it should be inputted.
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/typed.rs1
1 files changed, 1 insertions, 0 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)..;