From 860c2a606d7c779b5f1e3bb6653e5dd957111b11 Mon Sep 17 00:00:00 2001 From: Jason Gedge Date: Tue, 1 Sep 2020 00:10:46 -0400 Subject: [PATCH] More bug fixes for completions (#2476) * Use the cursor position for the span when between locations. This fixes a bug where completing ls would result in replacing the entire line. * Revert to the default update implementation. Replacing the length of the elected value was intended to do replacement when one moves inside a quote. The problem is that a long elected suggestion could replace bits of a pipeline that are after the cursor. For example: ls | get name | str collect --- crates/nu-cli/src/completion/engine.rs | 4 ++-- crates/nu-cli/src/shell/helper.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/nu-cli/src/completion/engine.rs b/crates/nu-cli/src/completion/engine.rs index 169efc3b59..8995f56344 100644 --- a/crates/nu-cli/src/completion/engine.rs +++ b/crates/nu-cli/src/completion/engine.rs @@ -232,10 +232,10 @@ pub fn completion_location(line: &str, block: &Block, pos: usize) -> Vec