Christian Brabandt wrote:

> On Mo, 25 Feb 2013, [email protected] wrote:
> 
> > Status: New
> > Owner: ----
> > Labels: Type-Defect Priority-Medium
> > 
> > New issue 115 by [email protected]: 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 -- [email protected] -- 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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui