[patch] problem with substitute()

33 views
Skip to first unread message

Christian Brabandt

unread,
Sep 27, 2013, 4:41:03 PM9/27/13
to vim...@vim.org
Bram,
there seems to be a problem with substitute¹:

#v+
~$ vim -u NONE -N :echo substitute('-bb', '\zeb', 'a', 'g') -c ':q!'
-aabab
Press ENTER or type command to continue
~$
#v-

That looks wrong. Attach is patch that fixes it.
¹)http://stackoverflow.com/questions/19041109

Mit freundlichen Grüßen
Christian
--
Wo viel Ehrgefühl, da ist viel Ehrgeiz; aber gar nicht umgekehrt.
-- Jean Paul
substitute_fix.diff

Bram Moolenaar

unread,
Sep 28, 2013, 4:24:28 PM9/28/13
to Christian Brabandt, vim...@vim.org

Christian Brabandt wrote:

> Bram,
> there seems to be a problem with substitute¹:
>
> #v+
> ~$ vim -u NONE -N :echo substitute('-bb', '\zeb', 'a', 'g') -c ':q!'
> -aabab
> Press ENTER or type command to continue
> ~$
> #v-
>
> That looks wrong. Attach is patch that fixes it.
> ¹)http://stackoverflow.com/questions/19041109

Thanks!

--
The psychic said, "God bless you." I said, "I didn't sneeze." She
looked deep into my eyes and said, "You will, eventually." And, damn
if she wasn't right. Two days later, I sneezed. --Ellen Degeneres

/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages