On 7/9/06, Matthias-Christian Ott <[EMAIL PROTECTED]> wrote:
Yakov Lerner wrote:
> This is wrong.
> You want "\n", not '\n'.
Ok, but the problem still exists.
vnoremap <silent> <C-W> :call FormatDeclarationSelection ()<CR>
function FormatDeclarationSelection ()
execute ":silent! normal gvs"
let lines = split (@", '\n')
The problem has nothing to do with split().
The selection is multi-line. This the mappnig
implicitly invokes the function N times, once for every
selected line.
The solution is to add keyword "range" to the function header line:
function FormatDeclarationSelection () range
This makes the mapping to invoke the funcion once, not
once-per-line. See :help function-range-example
Yakov