When using <C-V> "motion force" with a Visual selection in
Operator-pending mode Vim selects the wrong thing.
Consider the following function.
function! FirstTwoLines()
let [lnum, col] = searchpos('^$', 'bnW')
call setpos("'<", [0,lnum+1,col,0])
call setpos("'>", [0,lnum+2,col+8,0])
exe "normal! `<v`>"
endfunction
This function searches upwards for an empty line, then selects a line
and a few characters below it. Try it: ":call FirstTwoLines()".
Now define the following Operator-pending mode map:
onoremap F :<C-U>call FirstTwoLines()<CR>
Now "dF", "dvF", "dVF" all delete the selected bit. (The "motion force"
is ignored.) This is fine.
But "d<C-V>F" does not work the same way. It selects something
completely different: a Visual block from the cursor position to the end
of the selection ('>).
David Bürgin
--
--
You received this message from the "vim_dev" 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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.