Friday, March 4, 2011

in sub-replace-expression('\=')

Hi all;

Could anyone tell me why <NL>(0x0a) should be replaced by <CR>(0x0d)
in sub-replace-expression('\=')?

See the following code snippet;

function! s:nl()
return "\n"
endfunction
echomsg substitute('a', '.', "\n", "") "(1)
echomsg substitute('a', '.', '\=s:nl()', "") "(2)

(1) returns <NL>(0x0a), (2) returns <CR>(0x0d).

Why such design choice was done?

Thank you in advance.

Motoya Kurotsu

--
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: