Score:0

How to stop automatic candidate insertion with ibus-table?

us flag

I’m using ibus-table (specifically, ibus-table-latex) and would like to disable the following behavior: When I start typing something that triggers ibus-table’s candidate list (e. g. any part of \rightarrow, such as \rightar), the candidate list opens and the best-matching candidate is already “pre-selected” for insertion. See the following screenshot:

ibus-table-latex input example

My problem is that even when I press a key that’s not in the “valid input characters” list, such as % or !, this pre-selected top candidate is inserted instead of what I typed. So, for example, typing \rightarr! results in →!, but what I want is for the text to appear exactly as entered in this case.

I’ve tried a few different options:

  • I’ve noticed that pressing Enter does something similar to what I want (not sure where this comes from; it’s nowhere on the key bindings tab in the preferences): It preserves the text typed in so far and closes the candidate list. However, I don’t want to have to press a special key to do this.
  • The “commit to preedit” key binding (default: Shift) is somewhat similar, but instead of using the characters entered so far, it “auto-completes” the text for the current candidate, but without replacing it with the corresponding symbol. It doesn’t look like this could work for what I want.
  • The “cancel” key binding (default: Esc) doesn’t select the candidate, but gets rid of the entered text entirely, so that’s not helpful.
  • The “commit” key binding (default: Space) just uses the top candidate immediately.

Another potentially relevant thing I’ve found is the “Auto select” setting in the preferences:

ibus-table-latex preferences

However, this is set to “No”, so I don’t think this is causing my problem.

Gunnar Hjalmarsson avatar
uz flag
Please don't spam Ask Ubuntu with multiple questions on the same topic. You already submitted https://askubuntu.com/questions/1455600 . Instead of submitting a new question, you should have edited the other one.
Socob avatar
us flag
@GunnarHjalmarsson Excuse me? These are completely separate questions. Are you saying that merely because I mentioned `ibus-table-latex` in both of them, that I should just put everything in one big question?
Gunnar Hjalmarsson avatar
uz flag
Maybe I didn't read carefully enough. My apologies. If I was you, I'd ask for documentation in an issue at github. I know the maintainer from other projects, and he is usually very helpful.
Score:0
us flag

As suggested by Gunnar Hjalmarsson, I have opened an issue on GitHub to ask about this. It seems like this is (currently) not possible without modifying the code for ibus-table, but the necessary changes are minimal and can easily be done manually:

diff --git a/engine/table.py b/engine/table.py
index 6953e6f..4dcdc7a 100644
--- a/engine/table.py
+++ b/engine/table.py
@@ -4172,7 +4172,7 @@ class TabEngine(IBus.EngineSimple): # type: ignore
             if DEBUG_LEVEL > 0:
                 LOGGER.debug(
                     'trailing invalid input: keychar=%s', keychar)
-            if not self._candidates:
+            if not self._candidates or True:
                 self.commit_string(self.get_preedit_tabkeys_complete())
             else:
                 self.commit_to_preedit()
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.