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?
Natércia
--
--
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.
\documentclass[review]{elsarticle}
% Revision commands
\usepackage{ulem}
\usepackage{color}
\newcommand{\xxx}[2]{{\color{magenta}\sout{#1}}{\color{red}{#2}}}
\usepackage{changebar}
\begin{document}
These are small examples.
In this example \xxx{bla bla}{it works smooth}.
But in the next one the things go wrong...
\xxx{\%danger}{}
This is the following line.
\xxx{}{
\section*{Important stuff to add}
This is a much more complicate case with an xxx command inside another (in the caption of a figure)s and also with several lines in the arguments of xxx.
\begin{figure}[t!]
\centering
\caption{\xxx{}{Add caption of empty figure.}}
\label{fig:empty}
\end{figure}
}
\end{document}
\documentclass[review]{elsarticle}
% Revision commands
\usepackage{ulem}
\usepackage{color}
\newcommand{
\usepackage{changebar}
\begin{document}
These are small examples.
In this example t works smooth.
But in the next one the things go wrong...
{
This is the following line.
\section*{Important stuff to add}
This is a much more complicate case with an xxx command inside another (in the caption of a figure)s and also with several lines in the arguments of xxx.
\begin{figure}[t!]
\centering
\caption{Add caption of empty figure.}
\label{fig:empty}
\end{figure}
\end{document}