From 68488fd7a388d31704643a3257eb97920bcdd54a Mon Sep 17 00:00:00 2001 From: Jaehwang Jerry Jung Date: Mon, 6 Dec 2021 14:26:19 +0900 Subject: [PATCH] Fix unexpected cursor movement on on-demand imap loading (#1147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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` will place the cursor right below `a`. However, `` 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. --- plug.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plug.vim b/plug.vim index b6e4cbf..ad95041 100644 --- a/plug.vim +++ b/plug.vim @@ -405,7 +405,7 @@ function! plug#end() for [map, names] in items(lod.map) for [mode, map_prefix, key_prefix] in - \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] + \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] execute printf( \ '%snoremap %s %s:call lod_map(%s, %s, %s, "%s")', \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix)