Skip to content

Commit

Permalink
Fix autocomplete suggestions not being updated after a suggestion is …
Browse files Browse the repository at this point in the history
…accepted

Co-authored-by: Ilia <[email protected]>
Co-authored-by: Moritz Hölting <[email protected]>
  • Loading branch information
3 people committed Sep 29, 2024
1 parent 3cd5d7a commit 398ea88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## [Unreleased] <!-- ReleaseDate -->

- Fix autocomplete suggestions not being updated after a suggestion is accepted. Thanks @moritz-hoelting and @istudyatuni for reporting and fixing it!
- Fix incorrect cursor placement when inputting CJK characters. Thanks @phostann (#270) for reporting it!
- Removed unused dependency (newline-converter). Thanks @jonassmedegaard (#267) for catching it!

Expand Down
10 changes: 9 additions & 1 deletion inquire/src/prompts/text/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,15 @@ where
TextPromptAction::MoveToSuggestionPageDown => {
self.move_cursor_down(self.config.page_size)
}
TextPromptAction::UseCurrentSuggestion => self.use_current_suggestion()?,
TextPromptAction::UseCurrentSuggestion => {
let result = self.use_current_suggestion()?;

if let ActionResult::NeedsRedraw = result {
self.update_suggestions()?;
}

result
}
};

Ok(result)
Expand Down

0 comments on commit 398ea88

Please sign in to comment.