Hi

On Wednesday, March 20, 2013 1:07:53 AM UTC+1, Sung Pae wrote:
> On Tue, Mar 19, 2013 at 04:39:11PM -0700, Kana Natsuno wrote:
> 
> 
> 
> > On Wed, Mar 20, 2013 at 7:21 AM, Sung Pae wrote:
> 
> >
> 
> > > The motion mappings created by the above function work with both
> 
> > > native operators and with the custom operators provided by two other
> 
> > > plugins by Tim Pope: vim-surround and vim-commentary.
> 
> >
> 
> > Really?  Suppose that we invoke a new Vim process with the following
> 
> > environment:
> 
> >
> 
> > ------------------------------------------------------------
> 
> 
> 
> Yes, this combination does fail due to the implementation of the `ys`
> 
> operator. This can be ameliorated, but it would not be pretty.
> 
> 
> 
> Other combinations do not fail (like the `gc` vim-commentary operator
> 
> with the `af` text object), and the native operators with custom text
> 
> objects work well.
> 
> 
> 
> Again, this is a hack against the constraints of the bug you have
> 
> pointed out, which I am very much in favor of seeing fixed. Do you have
> 
> a patch to supply to the list, or should I look into it?
> 
> 
> 
>     Sung Pae

I spent some time looking into this. Attached is a first *proposal* for
a patch for the current Vim version 7.3.875, which -- I believe -- fixes
this.

However, the code surrounding Visual mode and operators is rather ...
tricky to say the least, so I urge you to look it over carefully, and
comment on whether you think it is correct or how it could be improved.

There has not been any response on the status of this issue. Operators
and text objects are two of the major advantages Vim has over other
editors. So I believe it is essential to let users leverage the full
power of their own custom operators and text objects by making them
repeatable with the dot command.

David Bürgin

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


diff -r acf7368a2acc src/normal.c
--- a/src/normal.c	Thu Mar 21 22:53:50 2013 +0100
+++ b/src/normal.c	Sat Mar 23 17:44:31 2013 +0100
@@ -1508,7 +1508,8 @@
 	/* never redo "zf" (define fold) */
 	if ((vim_strchr(p_cpo, CPO_YANK) != NULL || oap->op_type != OP_YANK)
 #ifdef FEAT_VISUAL
-		&& (!VIsual_active || oap->motion_force)
+		&& ((!VIsual_active || oap->motion_force)
+		    || (VIsual_active && cap->cmdchar == ':'))
 #endif
 		&& cap->cmdchar != 'D'
 #ifdef FEAT_FOLDING
@@ -1797,7 +1798,7 @@
 		    prep_redo(oap->regname, 0L, NUL, cap->cmdchar, cap->nchar,
 					get_op_char(oap->op_type),
 					get_extra_op_char(oap->op_type));
-		else
+		else if (cap->cmdchar != ':')
 		    prep_redo(oap->regname, 0L, NUL, 'v',
 					get_op_char(oap->op_type),
 					get_extra_op_char(oap->op_type),

Raspunde prin e-mail lui