Monday, April 23, 2012

Re: questions about submatch()

Tnx John and Ben.
Please let me ask one more question about submatch()

If I use submatch like this:
:%s/'pattern'/\=MyFunction(submatch())/g

function! MyFunction(m)

variable x
do something with variable x

return x
endfunction


I would like to confirm (with a "c" flag) all single substitutions
but the "c" flag at the end of the substitution command (:%s/'pattern'/\=MyFunction(submatch())/gc) doesn't work.

--
You received this message from the "vim_use" 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

No comments: