Skip to content

Commit

Permalink
If an input method transliterates a single character into another sin…
Browse files Browse the repository at this point in the history
…gle character use the transliterated result for Compose

Resolves: #654
  • Loading branch information
mike-fabian committed Feb 25, 2025
1 parent f834596 commit d25414f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion engine/hunspell_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -7921,8 +7921,18 @@ def _handle_compose(self, key: itb_util.KeyEvent, add_to_preedit: bool = True) -
return True
if key.val in (IBus.KEY_BackSpace,):
self._typed_compose_sequence.pop()
else:
elif not self._input_mode or len(key.msymbol) > 1:
self._typed_compose_sequence.append(key.val)
else:
transliterated_msymbol = self._transliterators[
self.get_current_imes()[0]
].transliterate([key.msymbol],
ascii_digits=self._ascii_digits)
if transliterated_msymbol == key.msymbol:
self._typed_compose_sequence.append(key.val)
else:
new_keyval = IBus.unicode_to_keyval(transliterated_msymbol)
self._typed_compose_sequence.append(new_keyval)
if not self._typed_compose_sequence:
if self._debug_level > 1:
LOGGER.debug('Editing made the compose sequence empty.')
Expand Down

0 comments on commit d25414f

Please sign in to comment.