Vim: 8.0
OS: Linux (Arch)
eregex: 950027d
Messages created with echom(sg) aren't displayed correctly or saved to the message history when using :%S/<pattern>/\=<expression>/.
echom-vimrc
call plug#begin()
Plug 'othree/eregex.vim'
call plug#end()
set nocompatible
" echo the supplied arg and return it unchanged
function! Echo(arg)
echomsg 'arg: ' . a:arg
return a:arg
endfunction
steps to reproduce
native (:substitute)
- open a file with
vim -u echom-vimrc test.txt
- insert the word "foo", and replace it with:
:%s/foo/\=Echo('bar')/
- undo the change, then re-run the substitution
- the message ("arg: foo") is displayed after each substitution, and appears twice in the output of
:messages
eregex (:S)
- open a file with
vim -u echom-vimrc test.txt
- insert the word "foo", and replace it with:
:%S/foo/\=Echo('bar')/
- undo the change, then re-run the substitution
- the message ("arg: foo") is only displayed after the first substitution, and doesn't appear at all in the output of
:messages
Vim: 8.0
OS: Linux (Arch)
eregex: 950027d
Messages created with
echom(sg)aren't displayed correctly or saved to the message history when using:%S/<pattern>/\=<expression>/.echom-vimrc
steps to reproduce
native (
:substitute)vim -u echom-vimrc test.txt:%s/foo/\=Echo('bar')/:messageseregex (
:S)vim -u echom-vimrc test.txt:%S/foo/\=Echo('bar')/:messages