Thursday, January 27, 2011

Re: bufdo and macro

On Tue, 25 Jan 2011 09:06:14 +1100
Ben Schmidt <mail_ben_schmidt@yahoo.com.au> wrote:
[snip]
> This pattern looks a bit funny to me; it could be the cause of the
> problem, though it doesn't seem all that likely, to be honest. But are
> you sure it is doing what you want? It looks like you are trying to
> use submatches \1 \2 \3 in your substitute text, but there are no \
> where I would expect to see them, and no subpatterns marked with
> \( and \) in the pattern, nor any \v very-magic directive. There is
> also a & in the substitute text, which will stand for the whole
> matched pattern; maybe it is continually replacing the pattern with
> itself and finding it again, and recursing that way. It seems
> unlikely you would have messed this up, though. But perhaps some
> setting is different in one/some of the other buffers that it is
> making it work differently?


I copy-pasted the line and did not see that the \ were removed for some
reason. The 1,2,3 all have \ of cause.

:%s/expectedMessage = &(\(\(.*\) *\)\(.*\);/CsrMemCpy(expectedMessage,
\&((1 *) 2, sizeof(1));/

[snip]
> Also, all your buffers are detected as having the same filetype,
> aren't they? So there shouldn't be any different mappings for some of
> the buffers? Or does this rely somehow on some setting that a syntax
> plugin sets, and so is breaking because syntax autocommands are
> skipped by :bufdo?
>
> I'm just throwing ideas out there...none of them seems all that likely
> to be the solution, to be honest....
>
> Good luck!


Yep all of them are C files and opened the same way.

kim

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

No comments: