On 9 April 2014, Natércia Fernandes <[email protected]> wrote:
> On Wednesday, April 09, 2014 07:58:15 PM you wrote:
> >     I can't reproduce this with this exact macro:
> > 
> >         /\\xxx\>^Mdt{d%%x``x@q
> > 
> >     The result I get is what I'd expect:
> > 
> > This is a text line.  And the next will be a completely new line.
> > 
> > Another line of text.
> > 
> >     Vim 7.4.253, editing a LaTeX file (this might be relevant).
> > 
> >     /lcd
> 
> Hi,
> that is strange.  I've tried again and that behavior persists.  I'm
> using Vim 7.4 and I'm editing a LaTeX file. I'm attaching a minimal
> file-example:
> before.tex    having the original source
> after.tex             having what I get after I applied the macro indicated 
> above.
>
> All the occurrences get transformed ok (even the last one, more
> complicated) but not the second one.
>
> I also tried to apply the commands that make the macro directly to
> that 2nd occurrence and it fails when trying to do the `` command.
> Notice that it deletes one character (as x says) but it the wrong
> place (at the beginning of the previous xxx that had been already
> executed because it was from there it had jumped before). `` picks up
> the wrong jump, instead of the last, it picks up the last but one.
>
> Before creating the macro I position the cursor for instance in the
> line \begin{document} so that that zero occurrence of xxx (where I
> define the command \xxx.
>
> Am I overlooking something?

    I see.  The difference comes from virtualedit: I have it set to
all, you seem to have it left to the default (which is unset).  As a
workaround, you can triple the last %, so that `` jumps to the right
place. :) It's also probably a good idea to search for \\xxx{ rather
than \\xxx\>, to avoid matching the definition of \xxx.  To summarize
it:

        /\\xxx{^Mdt{d%%%%x``x@qq
              ^        ^^

    /lcd

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to