Loading ...
Sorry, an error occurred while loading the content.

Re: gVim: Non-breaking space strangely triggers :simalt~

Expand Messages
  • Sylvia Ganush
    ... You are right. The broken mapping was just a question of a misplaced space character. Sorry for the wrong clue. ... Insert mode. ... Well, that s what
    Message 1 of 9 , Mar 15, 2013
    • 0 Attachment
      On 15 Mar 2013, at 21:58, Ben Fritz <fritzophrenic@...> wrote:

      > I doubt these two issues are related.

      You are right. The broken mapping was just a question of a misplaced space character. Sorry for the wrong clue.

      > For your original issue, what mode are you in when you try to use this autohotkey script?

      Insert mode.

      > Why do you expect it to "paste" something?

      Well, that's what Autohotkey does. 'Paste' must be a wrong word, though. Let's say, Autohotkey 'injects' a string. You type a hotstring followed by a trigger character and it expands it. In my case the hotstring 'excl'-Space should be expanded to ' !'. gVim stumbles at the nonbreaking space that precedes the exclamation mark and fires ':simalt ~' instead. This equals to Alt-Space which brings up the window's title bar menu, the one with 'Restore, Move, Size...' commands. I hit Escape, the script resumes and enters '!' only.

      > Can you still get this issue to occur? You said it only affects one instance of Vim and the rest are fine.

      Yes, and this is odd. I have one gVim session with three tabs and several windows where the issue is present. Then I open another instance of gVim and it's fine. But if I open the same tabs and windows in that trouble-free new instance and save it as a session, the issue reappears.

      > I don't know anything at all about autohotkey so I can't debug that side. But Vim shouldn't show the menu unless it actually gets an alt keypress, and then it shouldn't show the menu at all if 'winaltkeys' is set to "no".

      After some research I was prepared to believe that one can't marry Autohotkey to gVim as far as entry of special characters is concerned because their ways of doing it were different. I thought that Autohotkey used something like 'Alt-0160' whereas gVim expected Ctrl-K-Space-Space. But it does work in a virgin session! Why, oh why?

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Sylvia Ganush
      ... I think I ve tracked the bug. I ve compared the ill and healthy gVim sessions and spotted the offending lines: Ill session Healthy session
      Message 2 of 9 , Mar 16, 2013
      • 0 Attachment
        On 15 Mar 2013, at 21:58, Ben Fritz <fritzophrenic@...> wrote:

        > Can you still get this issue to occur? You said it only affects one instance of Vim and the rest are fine.

        I think I've tracked the bug. I've compared the 'ill' and 'healthy' gVim sessions and spotted the offending lines:

        Ill session Healthy session
        ==================== ====================
        cnoremap :simalt ~ cnoremap :simalt ~
        inoremap :simalt ~ inoremap :simalt ~
        cnoremap  :simalt ~ ...
        inoremap  :simalt ~ ...
        noremap :simalt ~ noremap :simalt ~
        noremap  :simalt ~ ...

        It's those lines with 'Â' that were giving me the trouble. I've removed them from the ill session, and things are good again. Now the questions remain, of course, what those lines mean, where they came from, and how to prevent them from reappearing.

        I have the following two lines in my _vimrc that I think have something to do with 'simalt':

        au GUIEnter * simalt ~x "Maximize the window on startup
        source $VIMRUNTIME/mswin.vim "Enable Windows-style copypasting

        Can they be the culprit?

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Ben Fritz
        ... This should tell you any existing mappings starting with  and also what file defined them. Then it should be pretty easy to remove from that file. ...
        Message 3 of 9 , Mar 16, 2013
        • 0 Attachment
          On Saturday, March 16, 2013 3:21:10 AM UTC-5, Sylvia Ganush wrote:
          > On 15 Mar 2013, at 21:58, Ben Fritz <fritzophrenic@...> wrote:
          >
          >
          >
          > > Can you still get this issue to occur? You said it only affects one instance of Vim and the rest are fine.
          >
          >
          >
          > I think I've tracked the bug. I've compared the 'ill' and 'healthy' gVim sessions and spotted the offending lines:
          >
          >
          >
          > Ill session Healthy session
          >
          > ==================== ====================
          >
          > cnoremap :simalt ~ cnoremap :simalt ~
          >
          > inoremap :simalt ~ inoremap :simalt ~
          >
          > cnoremap  :simalt ~ ...
          >
          > inoremap  :simalt ~ ...
          >
          > noremap :simalt ~ noremap :simalt ~
          >
          > noremap  :simalt ~ ...
          >
          >
          >
          > It's those lines with 'Â' that were giving me the trouble. I've removed them from the ill session, and things are good again. Now the questions remain, of course, what those lines mean, where they came from, and how to prevent them from reappearing.
          >
          >
          >
          > I have the following two lines in my _vimrc that I think have something to do with 'simalt':
          >
          >
          >
          > au GUIEnter * simalt ~x "Maximize the window on startup
          >
          > source $VIMRUNTIME/mswin.vim "Enable Windows-style copypasting
          >
          >
          >
          > Can they be the culprit?

          Yes, they can. I'm not sure what exact mapping is interfering. If you think you've found the mapping, try (for example):

          :verbose map Â
          :verbose map! Â

          This should tell you any existing mappings starting with 'Â' and also what file defined them. Then it should be pretty easy to remove from that file.

          I don't actually think Vim will properly process an ALT+Number keycode though, if that's what your autohotkeys script is sending, unless you define your own mapping for it. Try it manually. If it doesn't work, then something like:

          :inoremap <A-1><A-2><A-3><A-4> TextToInsert

          should work, but it will require a mapping for every such key sequence.

          It sounds like autohotkey is sending an Alt+Space keysequence to Vim, and naturally Vim responds by brining up the menu as if you had manually typed Alt+Space explicitly.

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.