mike-fabian / ibus-typing-booster

ibus-typing-booster is a completion input method for faster typing
https://mike-fabian.github.io/ibus-typing-booster/
Other
228 stars 16 forks source link

ibus-typing-booster and RStudio: A condemned marriage? #259

Closed psads-git closed 2 years ago

psads-git commented 2 years ago

Please, Mike, see the video. To add the backticks, I used a shortcut (CTRL+SHIFT+J).

Thanks in advance!

https://user-images.githubusercontent.com/75945439/144471925-38d4953f-dcfc-447c-a0bd-d84c375c4638.mp4

mike-fabian commented 2 years ago

Control+Shift+J doesn’t do anything for me in rstudio.

Is some setup needed to make Control+Shift+J do something?

psads-git commented 2 years ago

Thanks, Mike. I forgot to mention that Control+Shift+J is a shortcut that I have configured. However, the problem occurs if after having written

ab e cd

one goes with left arrow to ab and selects ab and, after selection, SHIFT+2 (to insert quotes) and uses the right arrow successively .

https://user-images.githubusercontent.com/75945439/144593596-c7623ec0-85e5-4690-8163-8b29067282a7.mp4

mike-fabian commented 2 years ago

It looks like I cannot reproduce that:

https://user-images.githubusercontent.com/2330175/144615267-f3cfc68d-7de8-4f11-b215-b3fed1d94ba7.mp4

psads-git commented 2 years ago

Do you hit the right arrow immediately after hitting SHIFT+2, Mike?

mike-fabian commented 2 years ago

Actually on my US keyboard layout the " is not on the 2, so I type Shift+' on the US layout, but that doesn’t matter, we are typing a ", it doesn’t matter how.

After the " I type a Space, this has the effect that " appears around the ab and a space is inserted after that. So the result is "ab" e cd (two spaces between the "ab" and the e. After that type arrow-right a few times.

If I type arrow-right immediately instead of the space, it makes no difference at all, except that there is one space less and the result is "ab" e cd with only one space between "ab" and e.

psads-git commented 2 years ago

Here, Mike, if I use space instead of SHIFT+2, the problem does not occur. So, my guess is that there may be a conflict with some RStudio keyboard shortcut!

mike-fabian commented 2 years ago

It could be a timing issue.

Just guessing from how it looks like in your video. It looks like as if Typing Booster tries to reopen a preedit and then gets it wrong because it gets wrong surrounding text.

And in my video, no preedit is reopened (although I have the option “Enable reopening preedit” on.

It just doesn’t work for me in most cases on Fedora 35 (with the exception of in Firefox, where it still seems to work).

So in my case, I cannot see any reopening of preedits when testing in rstudio.

In your case it looks like it is sometimes happening and leads to chaos.

If my guess is right, switching that option off should help.

mike-fabian commented 2 years ago

I watched your first video again, this very much looks like preedits are reopening and the surrounding text is wrong at the moments when this happens.

psads-git commented 2 years ago

Good guess, Mike! With preedit reopening off, the problem does not occur!

mike-fabian commented 2 years ago

I really have to investigate what can be done about the buggy surrounding text support. This is something outside of ibus-typing-booster. There are problems in ibus and in the toolkits like GTK.

psads-git commented 2 years ago

Thanks, Mike. Because of the emergence of R Markdown, RStudio has become also a word processor, which I have been using for a while, quite intensively, with ibus-typing-booster turned off (due to the reported problem). With your suggestion of turning off preedit reopening, I can now use ibus-typing-booster together with RStudio, which helps me a lot.

I had noticed similar problems while typing on Microsoft Word on the web. I thought that it could be related with some conflict with the word prediction of Microsoft Word itself, but now I suspect that it may be also caused by the same buggy surrounding text support.

Similar problems occur with LyX. In this case, I turned off the autocomplete LyX feature, but to no avail.

Have a nice weekend, Mike!

mike-fabian commented 2 years ago

I'll close this one as this problem is not specific to RStudio, there are many problems with surrounding text currently.

I think the first step to improve the situation would be to follow up on this issue:

https://github.com/ibus/ibus/issues/2350

and figure out what is going on, what changed recently in ibus and/or GTK?

psads-git commented 2 years ago

Thanks, Mike.