Hirohito Higashi wrote:

> Hello Ingo!
> 
> 2015/5/3(Sun) 4:46:50 UTC+9 Ingo Karkat:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > Hello Vim developers,
> > 
> > if you do a :substitute/foo/bar/c and then choose (a)ll as the answer,
> > a repeat of the substitution via g& or :&& does not confirm each
> > substitution any more; i.e. the :s_c flag is *not* kept!
> > 
> > The documentation of g& and :s_& explicitly state that they "Keep the
> > flags from the previous substitute command".
> > 
> > Likewise, answering (l)ast omits a given :s_g flag on repetition.
> > 
> > 
> > The problem is that the static flags do_all and do_ask are modified by
> > the answers, and the modified answers are then reused on repetition,
> > whereas the original ones should be restored in that case. From do_sub()
> > :
> > 
> >     static int      do_all = FALSE;         /* do multiple substitutions 
> > per line */
> >     static int      do_ask = FALSE;         /* ask for confirmation */
> > 
> >     [...]
> >                     if (typed == 'l')
> >                     {
> >                         /* last: replace and then stop */
> >                         do_all = FALSE;
> >                         line2 = lnum;
> >                         break;
> >                     }
> >                     if (typed == 'a')
> >                     {
> >                         do_ask = FALSE;
> >                         break;
> >                     }
> > 
> > Note: This was originally raised on Stack Overflow:
> > http://stackoverflow.com/questions/30000450/why-vim-does-not-preserve-c-
> > flag-when-g-used
> 
> I understand this problem.
> I think this should be corrected.
> So, I wrote a patch. Please confirm this.

Thanks!

-- 
Shift happens.
                -- Doppler

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

Raspunde prin e-mail lui