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

Issue 26 in vim: Ctrl-C doesn't perform interrupt after map/unmap

Expand Messages
  • vim@googlecode.com
    Status: New Owner: ---- Labels: Type-Defect Priority-Medium New issue 26 by marcmo...@gmail.com: Ctrl-C doesn t perform interrupt after map/unmap
    Message 1 of 4 , Oct 10, 2011
    • 0 Attachment
      Status: New
      Owner: ----
      Labels: Type-Defect Priority-Medium

      New issue 26 by marcmo...@...: Ctrl-C doesn't perform interrupt after
      map/unmap
      http://code.google.com/p/vim/issues/detail?id=26

      What steps will reproduce the problem?

      1. $ echo "for i in range(1,4) | %s/r/x/gc | endfor" > temp.vim
      2. $ vim -N -u NONE -U NONE temp.vim
      3. :so %
      4. Note that issuing a Ctrl-C interrupts the loop
      5. :map <c-c> abc
      6. :unmap <c-c>
      7. :so %
      8. Issuing Ctrl-C do NOT interrupted the loop anymore.

      What is the expected output? What do you see instead?
      It was expected that the behavior of Ctrl-C before mapping and after
      mapping and unmapping would be the same, breaking the loop.

      What version of the product are you using? On what operating system?
      Vim 7.3 under Windows XP.

      Please provide any additional information below.
      As an attempt to workaround the problem it was tried to ':unmap <c-c>' and
      then ':map <c-c> <c-break>', using Ctrl-Break as described
      in ':help :map_CTRL-C', but it didn't worked, in despite that directly
      typing Ctrl-Break breaks the loop.

      Reference information:
      http://stackoverflow.com/questions/7485740/capturing-break-interrupt-command

      Attachments:
      vim_bugreport.txt 15.6 KB
      gvim_bugreport.txt 18.0 KB

      --
      You received this message from the "vim_dev" 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
    • vim@...
      Comment #1 on issue 26 by chrisbr...@googlemail.com: Ctrl-C doesn t perform interrupt after map/unmap https://code.google.com/p/vim/issues/detail?id=26 This
      Message 2 of 4 , Sep 30, 2014
      • 0 Attachment
        Comment #1 on issue 26 by chrisbr...@...: Ctrl-C doesn't perform
        interrupt after map/unmap
        https://code.google.com/p/vim/issues/detail?id=26

        This happens, because mapped_ctrl_c is never reset.

        This patch fixes it:
        diff --git a/src/getchar.c b/src/getchar.c
        --- a/src/getchar.c
        +++ b/src/getchar.c
        @@ -3707,6 +3707,9 @@ do_map(maptype, arg, mode, abbrev)
        {
        if (!did_it)
        retval = 2; /* no match */
        + else if (*keys == Ctrl_C)
        + /* If CTRL-C has been unmapped, reuse it for Interrupting */
        + mapped_ctrl_c = FALSE;
        goto theend;
        }


        --
        You received this message because this project is configured to send all
        issue notifications to this address.
        You may adjust your notification preferences at:
        https://code.google.com/hosting/settings

        --
        --
        You received this message from the "vim_dev" 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_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • vim@...
        Updates: Status: Fixed Comment #2 on issue 26 by chrisbr...@googlemail.com: Ctrl-C doesn t perform interrupt after map/unmap
        Message 3 of 4 , Oct 9, 2014
        • 0 Attachment
          Updates:
          Status: Fixed

          Comment #2 on issue 26 by chrisbr...@...: Ctrl-C doesn't perform
          interrupt after map/unmap
          https://code.google.com/p/vim/issues/detail?id=26

          Fixed by 7.4.468

          --
          You received this message because this project is configured to send all
          issue notifications to this address.
          You may adjust your notification preferences at:
          https://code.google.com/hosting/settings

          --
          --
          You received this message from the "vim_dev" 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_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • vim@...
          Comment #3 on issue 26 by marcmo...@gmail.com: Ctrl-C doesn t perform interrupt after map/unmap https://code.google.com/p/vim/issues/detail?id=26 Thank you
          Message 4 of 4 , Oct 9, 2014
          • 0 Attachment
            Comment #3 on issue 26 by marcmo...@...: Ctrl-C doesn't perform
            interrupt after map/unmap
            https://code.google.com/p/vim/issues/detail?id=26

            Thank you very much, Christian!

            --
            You received this message because this project is configured to send all
            issue notifications to this address.
            You may adjust your notification preferences at:
            https://code.google.com/hosting/settings

            --
            --
            You received this message from the "vim_dev" 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_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          Your message has been successfully submitted and would be delivered to recipients shortly.