File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,27 @@ function M.retrigger(keys)
38
38
c = type (c ) == " number" and vim .fn .nr2char (c ) or c
39
39
pending = pending .. c
40
40
end
41
+
41
42
local op = vim .v .operator
42
43
if op and op ~= " " and vim .api .nvim_get_mode ().mode :find (" o" ) then
44
+ -- we have to "<esc>" to ensure we're in normal mode
43
45
keys = " <esc>" .. op .. keys
44
46
end
45
47
local feed = keys .. pending
46
48
feed = M .replace_special (feed )
47
49
if vim .v .count ~= 0 then
48
50
feed = vim .v .count .. feed
49
51
end
50
- vim .api .nvim_input (feed )
52
+
53
+ vim .schedule (function ()
54
+ if op == " c" then
55
+ -- offset col + 1 due to "<esc>" from insert mode
56
+ local row , col = unpack (vim .api .nvim_win_get_cursor (0 ))
57
+ vim .api .nvim_win_set_cursor (0 , { row , col + 1 })
58
+ end
59
+
60
+ vim .api .nvim_input (feed )
61
+ end )
51
62
end
52
63
53
64
--- @param value string | LazyKeys
You can’t perform that action at this time.
0 commit comments