iVim icon indicating copy to clipboard operation
iVim copied to clipboard

iVim app switching problem

Open mchalkley opened this issue 4 years ago • 16 comments

I've been having an issue with iVim for many weeks now that's really puzzling. I only mentioned it once in a comment in another issue because I figured it must have something to do with my own specific usage, but now I'm not so sure. The problem is this:

About 10% of the time when I use Cmd-Tab to switch from another app to iVim, the cursor appears as a hollow block, rather than the normal solid one. When this happens, iVim has become confused and many of the keys don't work anymore. For example, in Insert mode, the return, space and backspace keys don't do anything. The only way to restore proper operation is to quit iVim and start over.

I have mapped 'ii' to Esc, so if I want to save the file, so I can quit iVim and reset it to working properly, I have to type ':wii'. Why the Esc causes the command to be executed, I don't know, but it works. ':qii' will then exit iVim and I can reopen it and everything's fine again, until I Cmd-Tab out and back in a few times then, sure enough, I'll see that the cursor is hollow and I have to repeat the process.

Any ideas? This is happening on an iPad Pro 10.5 and an iPad Pro 11 (2020 model, using 3 different bluetooth keyboards.

Mark

mchalkley avatar May 13 '20 14:05 mchalkley

The hollow block cursor means iVim is not getting focused. As a result, it is not getting input from the keyboard. But I am not sure why this happens just by reading your description.

Do you have a sure way (happens 100% of the time) to reproduce this problem? I need to make it happens at my end to figure out the cause and possible fix.

terrychou avatar May 14 '20 06:05 terrychou

The odd thing is that most of the keys do work - all of the alphanumeric character keys, for example.

Your comment regarding the keyboard input is definitely on the right track, because I started playing with some of the other keys on the keyboard, and found that the key that enables the onscreen keyboard doesn't work, either. Nor does the "world" key that switches from normal to emoji, etc. The caps lock key didn't function initially when it happened this morning, but I switched to Working Copy, made an edit on a different file there, and Caps Lock key worked fine, when I switched back to iVim, the problem was still ther, but the Caps Lock key light on the keyboard worked, but the functionality of it didn't, though the others mentioned above still didn't.

Experimenting further, if I turn the keyboard off completely, iVim doesn't recognize this, and the on-screen keyboard doesn't come up. Is there any way to tell iVim to internally re-enable the external keyboard, or reconnect to it, anything like that?

I can't reproduce it, except to say that if I Cmd-Tab to other apps and back a few times it will always recur for me.

mchalkley avatar May 14 '20 11:05 mchalkley

When the hollow block cursor shows, try touching the screen to see whether the cursor restores to its normal shape (therefore, whether it fixes the problem).

Can you please turn off all the hardware keyboard settings, such as caps lock key mapping, key repeating, to see whether the problem is still there?

What kinds of Bluetooth keyboards are you using? The external keyboard implementation of iVim seems not working well with keyboards from non-Apple manufacturers (you can see that there is another issue https://github.com/terrychou/iVim/issues/108 also on the related problem).

terrychou avatar May 15 '20 05:05 terrychou

Sometimes I ran into this issue. In my case I use Apple Magic Keyboard. My try is to have a few times of long press on the screen to bring back and forth the extended keyboard.

By the way can I join the TestFlight? I would like to share other feedbacks. Mine is [email protected] if I am allowed. Thanks!

htkm avatar May 17 '20 08:05 htkm

@htkm added you into the TestFlight testers group.

terrychou avatar May 18 '20 04:05 terrychou

@terrychou thank you so much!

htkm avatar May 18 '20 15:05 htkm

@terrychou I can confirm that tapping on the screen fixes the issue. Thank you again - iVim is simply awesome!!!

mchalkley avatar May 22 '20 17:05 mchalkley

@mchalkley so it seems something wrong with the focus part. I will look into it. Do you use and switch to iVim in split view mode, or in standalone mode?

terrychou avatar May 24 '20 06:05 terrychou

@terrychou I use it in standalone mode.

mchalkley avatar May 24 '20 11:05 mchalkley

@mchalkley made some improvement on focus and pushed it to TestFlight (2.20(3)), please try it to see whether the problem is solved.

terrychou avatar May 29 '20 06:05 terrychou

Would you please add me to TestFlight? [email protected] Thank you very much

@mchalkley made some improvement on focus and pushed it to TestFlight (2.20(3)), please try it to see whether the problem is solved.

suliveevil avatar May 29 '20 06:05 suliveevil

Would you please add me to TestFlight? [email protected] Thank you very much

@suliveevil done.

terrychou avatar May 29 '20 06:05 terrychou

Thank you😊

suliveevil avatar May 29 '20 06:05 suliveevil

@mchalkley made some improvement on focus and pushed it to TestFlight (2.20(3)), please try it to see whether the problem is solved.

@terrychou I've tested the focus improvement quite extensively and can say I haven't seen this issue recur, so I think you can consider it fixed. I am monitoring carefully to see if one issue I've never seen before recurs: I had 6 or 7 buffers open and was editing one of them when iVim became unresponsive. In trying to switch to other apps, I found that the whole iPad was behaving strangely, so I rebooted it, which cleared the problem, though I lost all my edits. I'm not opening a new issue for this, because it's only happened once, and I'm not even sure it's iVim-related yet.

mchalkley avatar May 30 '20 13:05 mchalkley

@mchalkley thanks for the feedback and glad to know its positive result. Feel free to report any issue at any time.

terrychou avatar May 31 '20 01:05 terrychou

I continue to see the reported behavior (iPad Magic Keyboard, Cmd-Tab, iVim not focused) very frequently when using the current App Store release. Did this fix make it beyond the TestFlight stage?

majick avatar Apr 15 '22 19:04 majick