Hello Vim developers, Patch 7.3.590 allows to set the visual selection directly via the marks '< and '>. I've found a problem with :set selection=exclusive (while developing a custom mapping): When the first selection after Vim startup is defined via setpos(), then reselected (gv) and yanked (y), it includes one character too much, as if the non-default 'selection' setting isn't taken into account (even though gv displays the correct selection).
#v+
fun! Test()
call setpos("'<", [0, 1, 2, 0]) | call setpos("'>", [0, 1, 4, 0])
normal! gvy
echomsg string(@@)
endfun
set selection=exclusive
call setline(1, 'foobar')
call Test()
" Should print "oo", actually prints "oob"
" Observe that a ":normal! gv" will correctly select only 2 characters.
" Do a different selection the usual way.
normal! 03lvlly
" Repeat the test.
call Test()
" Now prints "oo" correctly.
#v-
To reproduce, use above scriptlet or the identical attached script:
vim -N -u NONE -S bug-exclusive-selection-register-set.vim
Reproducible on huge builds of Vim 7.4a.44 on Linux/x64 and Vim 7.3.823
on Windows/x64.
-- regards, ingo
--
--
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.
bug-exclusive-selection-register-set.vim
Description: application/octetstream
