When you are in insert mode and the focus change to another windows and the back, then jvi is in command mode. But it should be still in insert mode.
Intentional. jVi exists in an environment it has no real control over. Keeping insert mode active is too risky and/or too much trouble.
Understand, the Java environment can be quite unpredictable
Actually it also happens if I click on a netbeans undocked window of the same session. So it is the environment
I realize that you documented this limitation already. May be you could rephrase "input mode" to "insert mode"?
A mouse click will stop input mode. Otherwise the mouse does not participate
in commands. Selections, i.e. highlighted text, are not used in any way.
> rephrase "input mode" to "insert mode"?
> Selections, i.e. highlighted text, are not used in any way
That's not accurate. If there is a java selection, enter either v, V or ^V to convert to visual mode selection. With a visual mode selection, enter ^G to convert to java selection.
Keep in mind that some people use NB (platform) commands/bindings that depend on the java selection.
If it is not true, then please change
Ok, I see somebody change it already :-)
And the phrase "input mode" you can find with:
"input mode" site:jvi.sourceforge.net
Wow, I'd forgotten about that page. The docs need a lot of work.
Sorry, don't want to be a "troll". I am just curious, why do you think "Keeping insert mode active is too risky and/or too much trouble"? I thought about it a lot, but couldn't come up with any reason?
Some areas I'm concerned with are
- jVi is not the main app
- The app, e.g. NetBeans, can change focus, bring up windows
- jVi doesn't necessarily get all the keystorkes
jVi (vim) has a huge amount of global state and I'm concerned that the state might get inconsistent with which window is focused. My highest priority is to provide a consistent experience, and behaving consistently after focus changes makes me feel better about providing that.
One thing not mentioned in the above list is how keystrokes are handled. In vim, you can be anywhere in the code and do "getTheNextCharacter" and if one is available it is returned, if not then it hangs. In jVi you can't do that, java doesn't expose a Q of characters; and even if it did and the user entered a "g" would you want to hang NetBeans while waiting for the next key? I'm thinking about some ways to run jVi in a seperate thread, not in the event thread and then maybe I could set up a Q, but that is a huge change.
You can make a feature request about this if you want.
Actually, I wish to have this function too, if you can add an option for this, would be awesome.
I hope it is able to edit like MacVim, which at least can keep insert mode in one tab.
tianyatomy, if I am in NetBeans and in insert mode, and I go to another app and then come back to NetBeans (by clicking on the top bar associated with the NB frame rather than on a window inside of NetBeans) then I am still in insert mode.
What situation is not working for you?
Hello, err, I'm tomy. Thanks for the reply.
Here is the situation :
When I move my cursor by a mouse click in insert mode, it change into command mode automatically, then I have to press [i] or [a] key to change it back.
In this case, I hope it can keep insert mode untill I press the [esc] key. I notice MacVim is doing like this.
I chose to use Netbeans instead of vim in iterm2 because I have gotten used to move the cursor by mouse click just like the mode I'm writting this comment on web page now, but I do like some functions of vi and jvi, so if there can be an option for that, which would be awesome.
Thanks and Regards!
I could see that if you click in the currently active editor window, then insert mode could be safely kept active.
If you want to work on such a patch, I'm willing to answer questions.
Yes, I want to work on such a patch.
Now, if I click in the currently active editor window, it change into command mode.
I want to keep the insert mode so I don't have to push [a] or [i] key again and again.
How do I start to do it?
Have you picked up the source and built it? The README files with the source should be of use. You may be able to debug your initial work with the standalone jVi (not as a module) and once that is working, you can build NB modules
Notice the debug option "Tools > Options > jViConfig > Debug > mouse events", you may want to turn that on.
Mouse clicks are handled by Scheduler::mousePress().
That should get you started.