mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-19 02:25:35 -07:00
Fix unexpected cursor movement on on-demand imap loading (#1147)
`i_CTRL-O` may change the cursor position in an unexpected way. For example, when `autoindent` is set, the user will expect that `i asdf<CR><C-O>` will place the cursor right below `a`. However, `<C-O>` moves the cursor to the first column of line 2. Expected: ``` asdf █ ``` Actual: ``` asdf █ ``` Therefore, it's desirable to use `i_CTRL-\_CTRL-O`, the variant of `i_CTRL-O` that does not move the cursor.
This commit is contained in:
parent
93a115718f
commit
68488fd7a3
2
plug.vim
2
plug.vim
@ -405,7 +405,7 @@ function! plug#end()
|
||||
|
||||
for [map, names] in items(lod.map)
|
||||
for [mode, map_prefix, key_prefix] in
|
||||
\ [['i', '<C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
|
||||
\ [['i', '<C-\><C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
|
||||
execute printf(
|
||||
\ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, %s, "%s")<CR>',
|
||||
\ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix)
|
||||
|
Loading…
Reference in New Issue
Block a user