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

Re: Issue 115 in vim: Vim Macro to generate ASCII characters

Expand Messages
  • vim@...
    Comment #10 on issue 115 by Go.Zu...@gmail.com: Vim Macro to generate ASCII characters http://code.google.com/p/vim/issues/detail?id=115 The vim version I
    Message 1 of 18 , Feb 26, 2013
    View Source
    • 0 Attachment
      Comment #10 on issue 115 by Go.Zu...@...: Vim Macro to generate ASCII
      characters
      http://code.google.com/p/vim/issues/detail?id=115

      The vim version I tested and works is 7.3.842. Also I applied this patch
      (from message 68488 ):
      ...
      While I don't can anything contribute to this specific problem, which
      seems to be related to Windows only, I noticed one specific problem.
      After recording the key-sequence above, I can't seem to be able to run
      that specific command again, i.e. it will always continue with the
      latest ascii code and continue increasing it. I suspect, this happens,
      because register " and 0 come out of sync and so recording to register "
      will always use the value from register 0.

      This patch fixes it:

      t a/src/ops.c b/src/ops.c
      --- a/src/ops.c
      +++ b/src/ops.c
      @@ -1089,7 +1089,9 @@

      retval = stuff_yank(regname, p);

      - y_previous = old_y_previous;
      + /* allow changing the default register, if it was specified */
      + if (regname != '"')
      + y_previous = old_y_previous;
      y_current = old_y_current;
      }
      }

      ...

      --
      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/groups/opt_out.
    • vim@...
      Comment #11 on issue 115 by fritzoph...@gmail.com: Vim Macro to generate ASCII characters http://code.google.com/p/vim/issues/detail?id=115 ... Are you sure?
      Message 2 of 18 , Feb 27, 2013
      View Source
      • 0 Attachment
        Comment #11 on issue 115 by fritzoph...@...: Vim Macro to generate
        ASCII characters
        http://code.google.com/p/vim/issues/detail?id=115

        > I don't have any vimrc file.

        Are you sure? Windows Vim looks in these places for a vimrc file, do ANY of
        them
        exist?

        $HOME/_vimrc
        $HOME/.vimrc
        $VIM/_vimrc
        $VIM/vimrc

        > I compiled vim with : nmake -f Make_mvc.mak GETTEXT=no FEATURES=HUGE
        > and now it works.
        > Also with FEATURES=BIG and FEATURES=NORMAL

        So...you recompiled and now the issue is not reproduceable, using the same
        config (or lackthereof)? Are you retracting your bug report?

        You didn't answer, is the issue reproduceable with:

        vim -N -u NONE -i NONE

        You said "I don't see anything" but I have no idea what you meant by that.
        Do
        you mean "it did not fix the issue" or "I don't see the issue" or even "Vim
        did
        not launch correctly"?

        --
        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/groups/opt_out.
      • vim@...
        Comment #12 on issue 115 by Go.Zu...@gmail.com: Vim Macro to generate ASCII characters http://code.google.com/p/vim/issues/detail?id=115 I verified, I don t
        Message 3 of 18 , Feb 27, 2013
        View Source
        • 0 Attachment
          Comment #12 on issue 115 by Go.Zu...@...: Vim Macro to generate ASCII
          characters
          http://code.google.com/p/vim/issues/detail?id=115

          I verified, I don't have any vimrc:
          $HOME/_vimrc
          $HOME/.vimrc
          $VIM/_vimrc
          $VIM/vimrc
          At the start of vim with vim -N -u NONE -i NONE, I see nothing , and after
          starting the issue is reproduceable.
          But I find the problem: The issue is reproduce able all time, also with the
          vim 7.3.842 when I used numeric keypad (on the right) to input 32 value.
          When I use the numeric keys above the letters, the macros works.
          Thanks a lot for helping !
          Best regards !

          --
          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/groups/opt_out.
        • vim@...
          Comment #13 on issue 115 by fritzoph...@gmail.com: Vim Macro to generate ASCII characters http://code.google.com/p/vim/issues/detail?id=115 I finally
          Message 4 of 18 , Feb 27, 2013
          View Source
          • 0 Attachment
            Comment #13 on issue 115 by fritzoph...@...: Vim Macro to generate
            ASCII characters
            http://code.google.com/p/vim/issues/detail?id=115

            I finally reproduced the issue, using the keypad like you discovered; so
            although you still didn't explain, it's probably not important at this
            point what you didn't see.

            I certainly would not expect this behavior, but I actually think I know the
            cause. I suspect it's because Vim actually distinguishes between 1 and
            <k1>, 2 and <k2>, etc. keys to allow mapping them differently. So the macro
            contains special escape sequences for the keypad keys which aren't present
            when using normal numerics.

            To demonstrate the difference, try the following:

            qao<k1><k2><k3><Esc>q
            qbo123<Esc>q

            Both these macros do the same thing when executed. Both will make a new
            line with text, 123. But now examine the register contents:

            :reg a
            :reg b

            For me at least, on Windows gvim, they are drastically different!

            Not all systems actually send Vim a different sequence for the keypad keys;
            on these systems, 1 and <k1> are not separately mappable.

            I think this will only pop up when somebody tries using a recorded macro
            both as a recording and as text for insertion and manipulation. I'm not
            sure whether it's possible to fix without breaking the separate mapping
            capability of the keypad, or even if there is something to fix at all.

            A person who wrote the macro in the first place would know what they were
            trying to accomplish at each step in the macro. When they pasted the
            contents of the unnamed register, hoping to get a numeric value which could
            then be incremented, if they saw the special escape sequences, they would
            immediately know something was wrong. I don't actually think there is
            anything to fix here, unless it's just seen as another place Vim's internal
            representation of special keys causes weird behavior.

            --
            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/groups/opt_out.
          • Bram Moolenaar
            ... Well, this would cause typing q to end recording to set the register used for the next put command. I don t think that is right. When yanking and
            Message 5 of 18 , Mar 7, 2013
            View Source
            • 0 Attachment
              Christian Brabandt wrote:

              > On Mo, 25 Feb 2013, vim@... wrote:
              >
              > > Status: New
              > > Owner: ----
              > > Labels: Type-Defect Priority-Medium
              > >
              > > New issue 115 by Go.Zu...@...: Vim Macro to generate ASCII characters
              > > http://code.google.com/p/vim/issues/detail?id=115
              > >
              > > What steps will reproduce the problem?
              > > 1.In a new buffer input the keystrokes line (macros) :
              > >
              > > q"<C-V>32<Esc>kqqqp<C-A>S<C-R>"q94@q
              > >
              > > What is the expected output?
              > >
              > [ascii code]
              > > ~
              > > What do you see instead?
              > > <start of buffer>
              > >
              > > €KF€KE k
              > > <End of buffer>
              > >
              >
              > While I don't can anything contribute to this specific problem, which
              > seems to be related to Windows only, I noticed one specific problem.
              > After recording the key-sequence above, I can't seem to be able to run
              > that specific command again, i.e. it will always continue with the
              > latest ascii code and continue increasing it. I suspect, this happens,
              > because register " and 0 come out of sync and so recording to register "
              > will always use the value from register 0.
              >
              > This patch fixes it:
              >
              > t a/src/ops.c b/src/ops.c
              > --- a/src/ops.c
              > +++ b/src/ops.c
              > @@ -1089,7 +1089,9 @@
              >
              > retval = stuff_yank(regname, p);
              >
              > - y_previous = old_y_previous;
              > + /* allow changing the default register, if it was specified */
              > + if (regname != '"')
              > + y_previous = old_y_previous;
              > y_current = old_y_current;
              > }
              > }

              Well, this would cause typing "q" to end recording to set the register
              used for the next put command. I don't think that is right. When
              yanking and pasting you normally do this with text, not with commands
              recorded to a buffer. It may cause a problem.

              Recording to the " buffer is a problem anyway, since it depends on what
              buffer this turns out to be. Better not use q" unless you know what
              register " refers to.

              --
              "You know, it's at times like this when I'm trapped in a Vogon airlock with
              a man from Betelgeuse and about to die of asphyxiation in deep space that I
              really wish I'd listened to what my mother told me when I was young!"
              "Why, what did she tell you?"
              "I don't know, I didn't listen!"
              -- Arthur Dent and Ford Prefect in Douglas Adams'
              "The Hitchhiker's Guide to the Galaxy"

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ an exciting new programming language -- http://www.Zimbu.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --
              --
              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/groups/opt_out.
            Your message has been successfully submitted and would be delivered to recipients shortly.