Make only_buffer_difference: true work (#11488)

This commit is contained in:
Yash Thakur
2024-01-11 12:58:14 -05:00
committed by GitHub
parent bd07f7b302
commit 0ebbc8f71c
5 changed files with 46 additions and 27 deletions

View File

@ -607,7 +607,10 @@ pub fn complete(engine_reference: Arc<EngineState>, file_path: &str, location: &
});
if let Ok(location) = location.as_i64() {
let results = completer.complete(&String::from_utf8_lossy(&file), location as usize);
let results = completer.complete(
&String::from_utf8_lossy(&file)[..location as usize],
location as usize,
);
print!("{{\"completions\": [");
let mut first = true;
for result in results {