othree / eregex.vim

Perl/Ruby style regexp notation for Vim
http://www.vim.org/scripts/script.php?script_id=3282
214 stars 18 forks source link

Substitution with an expression breaks messages #23

Open chocolateboy opened 7 years ago

chocolateboy commented 7 years ago

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)

eregex (:S)

othree commented 6 years ago

I can reproduce and I got 0 message. Still looking.

othree commented 6 years ago

It use silent to execute substitute ref: http://vimdoc.sourceforge.net/htmldoc/various.html#:silent

othree commented 6 years ago

Not sure why original author try to manage error by itsself. https://github.com/othree/eregex.vim/blob/master/plugin/eregex_e.vim#L4-L6 https://github.com/othree/eregex.vim/blob/master/plugin/eregex.vim#L844-L873