Do not prepend COUNT"REGISTER when feeding keys in insert mode
Close #543
This commit is contained in:
parent
f4427b97f1
commit
49c6b781e0
1 changed files with 12 additions and 10 deletions
22
plug.vim
22
plug.vim
|
@ -257,8 +257,8 @@ function! plug#end()
|
||||||
for [mode, map_prefix, key_prefix] in
|
for [mode, map_prefix, key_prefix] in
|
||||||
\ [['i', '<C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
|
\ [['i', '<C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
|
||||||
execute printf(
|
execute printf(
|
||||||
\ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, "%s")<CR>',
|
\ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, %s, "%s")<CR>',
|
||||||
\ mode, map, map_prefix, string(map), string(names), key_prefix)
|
\ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix)
|
||||||
endfor
|
endfor
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
@ -498,7 +498,7 @@ function! s:lod_cmd(cmd, bang, l1, l2, args, names)
|
||||||
execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
|
execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:lod_map(map, names, prefix)
|
function! s:lod_map(map, names, with_prefix, prefix)
|
||||||
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
||||||
call s:dobufread(a:names)
|
call s:dobufread(a:names)
|
||||||
let extra = ''
|
let extra = ''
|
||||||
|
@ -510,15 +510,17 @@ function! s:lod_map(map, names, prefix)
|
||||||
let extra .= nr2char(c)
|
let extra .= nr2char(c)
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
let prefix = v:count ? v:count : ''
|
if a:with_prefix
|
||||||
let prefix .= '"'.v:register.a:prefix
|
let prefix = v:count ? v:count : ''
|
||||||
if mode(1) == 'no'
|
let prefix .= '"'.v:register.a:prefix
|
||||||
if v:operator == 'c'
|
if mode(1) == 'no'
|
||||||
let prefix = "\<esc>" . prefix
|
if v:operator == 'c'
|
||||||
|
let prefix = "\<esc>" . prefix
|
||||||
|
endif
|
||||||
|
let prefix .= v:operator
|
||||||
endif
|
endif
|
||||||
let prefix .= v:operator
|
call feedkeys(prefix, 'n')
|
||||||
endif
|
endif
|
||||||
call feedkeys(prefix, 'n')
|
|
||||||
call feedkeys(substitute(a:map, '^<Plug>', "\<Plug>", '') . extra)
|
call feedkeys(substitute(a:map, '^<Plug>', "\<Plug>", '') . extra)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue