I'm trying to define an insert mapping like this:
inoremap <expr><buffer> ; (Test(expand('<cWORD>'))).";"
in which the
Test function is defined as:
func! Test(a) echom "cword: "."\"".a:a."\"" endfunction
For example, if the current position of the cursor is like:
When I type
;, I'm expecting a message says:
But currently, I can only get an empty result like:
The question is, why the
expand() function here always returns an empty string?