#128 Insert mode bug

Major
closed
nobody
None
5
2013-08-13
2011-04-01
sf min
No

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.

Discussion

  • Ernie Rael
    Ernie Rael
    2011-04-01

    • status: open --> open-wont-fix
     
  • Ernie Rael
    Ernie Rael
    2011-04-01

    Intentional. jVi exists in an environment it has no real control over. Keeping insert mode active is too risky and/or too much trouble.

     
  • sf min
    sf min
    2011-04-01

    Understand, the Java environment can be quite unpredictable

     
  • sf min
    sf min
    2011-04-02

    Actually it also happens if I click on a netbeans undocked window of the same session. So it is the environment

     
  • sf min
    sf min
    2011-04-02

    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.

     
  • Ernie Rael
    Ernie Rael
    2011-04-02

    > rephrase "input mode" to "insert mode"?

    Where?

    > 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.

     
  • sf min
    sf min
    2011-04-02

    And the phrase "input mode" you can find with:
    "input mode" site:jvi.sourceforge.net

     
  • Ernie Rael
    Ernie Rael
    2011-04-03

    Wow, I'd forgotten about that page. The docs need a lot of work.

     
  • Ernie Rael
    Ernie Rael
    2011-04-06

    • status: open-wont-fix --> closed-wont-fix
     
  • sf min
    sf min
    2011-04-07

    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?

     
  • Ernie Rael
    Ernie Rael
    2011-04-07

    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.

     
  • tomy
    tomy
    2013-01-30

    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.

     
  • Ernie Rael
    Ernie Rael
    2013-01-30

    • status: closed-wont-fix --> pending-wont-fix
     
  • Ernie Rael
    Ernie Rael
    2013-01-30

    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?

     
  • tomy
    tomy
    2013-01-31

    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!

     
  • Ernie Rael
    Ernie Rael
    2013-01-31

    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.

     
  • tomy
    tomy
    2013-02-01

    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?

     
  • Ernie Rael
    Ernie Rael
    2013-02-01

    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.

     
  • Ernie Rael
    Ernie Rael
    2013-08-13

    • status: pending-wont-fix --> closed
    • Group: --> Major