rhysd / clever-f.vim

Extended f, F, t and T key mappings for Vim.
https://rhysd.github.io/clever-f.vim
1.01k stars 44 forks source link

Fix for Vim 8.1.0648 #43

Closed thinca closed 5 years ago

thinca commented 5 years ago

From Vim 8.1.0648, the return value of operator-pending mode of mode(1) contains forced visual mode character at tail.

For example:

function! Cmd()
    let g:mode = mode(1)
    return ''
endfunction
onoremap <expr> i- Cmd()

normal di-
echo g:mode
" => 'no'

normal dvi-
echo g:mode
" => 'nov'

normal dVi-
echo g:mode
" => 'noV'

execute "normal d\<C-v>i-"
echo g:mode
" => "no\<C-v>"

The above change breaks this plugin.

This PR wraps mode() function to keep old behavior.

rhysd commented 5 years ago

Thank you! I did not know this and I did not notice it since I'm using slightly older Vim.