Hi Bram!

On So, 18 Mär 2012, Bram Moolenaar wrote:

> 
> Christian Brabandt wrote:
> 
> > On Do, 15 Mär 2012, Gary Johnson wrote:
> > 
> > > That's an odd error message, since there are no search commands in
> > > that sequence, as I understood it.  Using a different notation,
> > > here's what I typed.
> > > 
> > >     <C-V>G$A<BS><BS><Esc>
> > 
> > Was this ever supposed to work? 
> > 
> > Anyway, this is a bug. I have a patch that prevents this. But trying to 
> > make this works as intended by the OP requires some more work and I am 
> > still looking into this.
> 
> In my opinion, what should happen is that Vim notices that no characters
> have been added, thus will not try to replay the change to other lines.

ok. This patch fixes it:
diff --git a/src/ops.c b/src/ops.c
--- a/src/ops.c
+++ b/src/ops.c
@@ -2602,7 +2602,7 @@
        firstline = ml_get(oap->start.lnum) + bd.textcol;
        if (oap->op_type == OP_APPEND)
            firstline += bd.textlen;
-       if ((ins_len = (long)STRLEN(firstline) - pre_textlen) > 0)
+       if ((ins_len = (long)STRLEN(firstline) - abs(pre_textlen)) > 0)
        {
            ins_text = vim_strnsave(firstline, (int)ins_len);
            if (ins_text != NULL)


> Perhaps we could work on another operation in Visual mode for repeating
> a delete operator in a number of lines.  I don't think something would
> be need in Visual block mode, you can already delete or change a visual
> block.  It's probably only interesting to repeat a change or delete
> operation relative to the end of a line. 

Like what? I would think, that deleting something would only make sense
in visual block mode. That's why I thought, 

> As an easier way than using ":<range>s/..$//"

this would be nice.

regards,
Christian
-- 
Das Halbverstandene und Halberfahrene ist nicht die Vorstufe der
Bildung, sondern ihr Todfeind.
                -- Theodor W. Adorno (Theodor Ludwig Wiesengrund)

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

Raspunde prin e-mail lui