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

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

Expand Messages
  • Sylvia Ganush
    Thanks for your tip, Ben, but setting winaltkeys=no has made no difference. There s another space-related anomaly that I suspect may shed light on my issue.
    Message 1 of 9 , Mar 15 9:51 AM
    • 0 Attachment
      Thanks for your tip, Ben, but setting 'winaltkeys=no' has made no difference.

      There's another space-related anomaly that I suspect may shed light on my issue. One keymapping has stopped working. I have 'noremap <leader><space> :noh<cr>' in my _vimrc, but instead of suppressing search highlighting it pauses for a second and then moves the cursor one character to the right.

      Do you think this gives us a clue?

      On 13 Mar 2013, at 21:49, Ben Fritz <fritzophrenic@...> wrote:

      > On Wednesday, March 13, 2013 2:30:23 PM UTC-5, Sylvia Ganush wrote:
      >> This is the Autohotkey command:
      >>
      >> ::excl:: !
      >>
      >> The space before '!' is non-breaking, I inserted it with Ctrl-K-Space-Space in gVim.
      >>
      >> It would appear that the non-breaking space outputs Alt-Space which gets translated by gVim to :simalt. Why it happens remains a mystery. Why it happens only in one specific gVim session, and not in others remains an even bigger mystery.
      >>
      >>
      >
      > Ok, you said you were *pasting* a non-breaking space into Vim.
      >
      > This is not a "paste" command but rather a keyboard mapping to send Vim a non-breaking space and a ! whenever you press the ! key, correct?
      >
      > And somehow Vim is getting "alt+space" instead of a non-breaking space?
      >
      > You can try setting the 'winaltkeys' option in Vim to "no" so that Vim handles all alt key sequences internally. Otherwise Windows will handle the Alt+Space key combination without Vim doing anything with it.
      >
      > --
      > --
      > 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.
      >
      >

      --
      --
      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
      ... Please bottom post. I doubt these two issues are related. Your new issue is probably one of these: 1. something has undefined your mapping 2. you have a
      Message 2 of 9 , Mar 15 1:58 PM
      • 0 Attachment
        On Friday, March 15, 2013 11:51:08 AM UTC-5, Sylvia Ganush wrote:
        > Thanks for your tip, Ben, but setting 'winaltkeys=no' has made no difference.
        >
        >
        >
        > There's another space-related anomaly that I suspect may shed light on my issue. One keymapping has stopped working. I have 'noremap <leader><space> :noh<cr>' in my _vimrc, but instead of suppressing search highlighting it pauses for a second and then moves the cursor one character to the right.
        >
        >
        >
        > Do you think this gives us a clue?
        >
        >

        Please bottom post.

        I doubt these two issues are related.

        Your new issue is probably one of these:

        1. something has undefined your mapping
        2. you have a space character in your _vimrc file at the end of the line after your mapping definition

        In insert mode there is a 3rd option, but in your case this is a normal mode mapping so it doesn't apply:
        3. you have 'paste' set so mappings don't apply

        For your original issue, what mode are you in when you try to use this autohotkey script? Why do you expect it to "paste" something? Can you still get this issue to occur? You said it only affects one instance of Vim and the rest are fine.

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

        --
        --
        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
        ... 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 3 of 9 , Mar 15 3:22 PM
        • 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 4 of 9 , Mar 16 1:21 AM
          • 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 5 of 9 , Mar 16 9:49 AM
            • 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.