Skip to content

Commit

Permalink
Pass key which triggered cancel command to application if self._min_c…
Browse files Browse the repository at this point in the history
…har_complete == 0 and there are no candidates

Resolves: #505
  • Loading branch information
mike-fabian committed Apr 4, 2024
1 parent f77a182 commit 5ef20d6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion engine/hunspell_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -5550,8 +5550,17 @@ def _command_cancel(self) -> bool:
:return: True if the key was completely handled, False if not.
'''
if (self.is_empty()
and self._min_char_complete != 0
and not self._typed_compose_sequence):
if self.get_lookup_table().get_number_of_candidates():
# There might be candidates even if the input
# is empty if self._min_char_complete == 0.
# If that is the case, cancel these candidates
# and return True. If not, return False
# because then there is nothing to cancel and the
# key which triggered the cancel command should be
# passed through.
self._update_ui_empty_input()
return True
return False
if self._typed_compose_sequence:
if self._lookup_table_shows_compose_completions:
Expand Down

0 comments on commit 5ef20d6

Please sign in to comment.