diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 9dc3a2876d22a..acb580cd462b6 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -2219,12 +2219,15 @@ pub(super) fn command_mode(cx: &mut Context) { .. }) = typed::TYPABLE_COMMAND_MAP.get(&command as &str) { + let part_len = shellwords::escape(part.clone()).len(); + completer(editor, &part) .into_iter() .map(|(range, file)| { let file = shellwords::escape(file); + // offset ranges to input - let offset = input.len() - part.len(); + let offset = input.len() - part_len; let range = (range.start + offset)..; (range, file) })