diff --git a/src/completion/default.rs b/src/completion/default.rs index 73496b37..171e30f3 100644 --- a/src/completion/default.rs +++ b/src/completion/default.rs @@ -71,6 +71,9 @@ impl Completer for DefaultCompleter { fn complete(&mut self, line: &str, pos: usize) -> Vec { let mut span_line_whitespaces = 0; let mut completions = vec![]; + // TODO trimming here is only necessary if someone passes in text containing + // stuff after the cursor with `only_buffer_difference: false` + let line = if line.len() > pos { &line[..pos] } else { line }; if !line.is_empty() { let mut split = line.split(' ').rev(); let mut span_line: String = String::new();