diff --git a/src/shell/completer.rs b/src/shell/completer.rs index 68a21725bbac98c58be81596ef47c65545ee712f..920259685e7a004a37df7d11bb8d2cc8f1e7ec34 100644 --- a/src/shell/completer.rs +++ b/src/shell/completer.rs @@ -76,7 +76,7 @@ impl Completer for IonFileCompleter { // search pattern begins, and re-use that index to slice the completions so // that we may re-add the tilde character with the completion that follows. if let Some(completion) = iterator.next() { - if let Some(e_index) = completion.find(search) { + if let Some(e_index) = completion.rfind(search) { completions.push(escape(&[tilde, &completion[e_index..]].concat())); for completion in iterator { let expanded = &completion[e_index..];