@@ -2847,13 +2847,10 @@ pub(super) fn command_mode(cx: &mut Context) {
28472847 } else {
28482848 // Otherwise, use the command's completer and the last shellword
28492849 // as completion input.
2850− let (part, part_len) = if words.len() == 1 || shellwords.ends_with_whitespace() {
2850+ let (word, word_len) = if words.len() == 1 || shellwords.ends_with_whitespace() {
28512851 (&Cow::Borrowed(""), 0)
28522852 } else {
2853− (
2854− words.last().unwrap(),
2855− shellwords.parts().last().unwrap().len(),
2856− )
2853+ (words.last().unwrap(), words.last().unwrap().len())
28572854 };
28582855
28592856 let argument_number = argument_number_of(&shellwords);
@@ -2862,13 +2859,13 @@ pub(super) fn command_mode(cx: &mut Context) {
28622859 .get(&words[0] as &str)
28632860 .map(|tc| tc.completer_for_argument_number(argument_number))
28642861 {
2865− completer(editor, part)
2862+ completer(editor, word)
28662863 .into_iter()
28672864 .map(|(range, file)| {
28682865 let file = shellwords::escape(file);
28692866
28702867 // offset ranges to input
2871− let offset = input.len() - part_len;
2868+ let offset = input.len() - word_len;
28722869 let range = (range.start + offset)..;
28732870 (range, file)
28742871 })