Skip to content

Commit

Permalink
Fix completion triggering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
danhper committed Aug 9, 2024
1 parent c299275 commit b907851
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### Bug fixes

* Fix `abi.decode` for nested types
* Fix completion not triggering right after `[`

### Other changes

Expand Down
4 changes: 3 additions & 1 deletion src/repl/completer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ impl MyCompleter {
}

fn get_current_word(line: &str, pos: usize) -> (&str, usize) {
let start = line[..pos].rfind(&[' ', '(', ',']).map_or(0, |i| i + 1);
let start = line[..pos]
.rfind(&[' ', '(', ')', ',', '[', ']'])
.map_or(0, |i| i + 1);
(&line[start..pos], start)
}

Expand Down

0 comments on commit b907851

Please sign in to comment.