-----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
- -- regards, ingo
- --
-- Ingo Karkat -- /^-- /^-- /^-- /^-- /^-- http://ingo-karkat.de/ --
-- http://vim.sourceforge.net/account/profile.php?user_id=9713 --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
iQEcBAEBAgAGBQJVRSmmAAoJEA7ziXlAzQ/vOfoH/jGlusMXE5qlURe1LxQemJmd
M+RyXnCLHOZFR2mBN0owhiPQx6512orde5IuC9+qF4cMyeKi4LfxY9Gq1SKyNs+t
B79uDUuq7JxGUhML2zpvk1xNxfnLrtf9AvvITRFJVj4kM3XC6Qhk3JQOE4mJhHLE
GVYyNZakrBtyoNG2IrpwHzljYuTgqI62INpebVRsoCIapNI6FUoqrTNTq7G0p7gS
wbX50gtsA0AGNnlK5GClCG5RZt1C7lnluup8BZFUDy4fzzuqyxk3xY8JKK/xbizu
XIFjlTYIYckQkKRzfSODXSV/BgwsH4sAv++PorrFJIyCqYEEM1pFEnU6ca60M1E=
=vFcA
-----END PGP SIGNATURE-----
--
--
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.