Skip to content

Commit

Permalink
fix(snippet): works with different virtualedit, fix neoclide#265
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Dec 13, 2018
1 parent 6f054cb commit b1a9321
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autoload/coc/snippet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ endfunction

function! s:start_select(lnum, col, len)
call cursor(a:lnum, a:col)
let ed = &virtualedit
if a:len > 0
let m = a:len == 1 ? '' : (a:len - 1).'l'
execute 'normal! v'.m. "\<C-g>"
elseif mode() !=# 'i'
if strlen(getline('.')) + 1 == a:col
if strlen(getline('.')) + 1 == a:col && ed !=# 'onemore' && ed !=# 'all'
call feedkeys("a", 'int')
else
call feedkeys("i", 'int')
Expand Down

0 comments on commit b1a9321

Please sign in to comment.