00sapo/visual.nvim

Edit commands are not repeatable

00sapo opened this issue · 3 comments

00sapo commented

This is due to the fact that the . command repeats edit commands that happened from normal mode only. We need to remap edit commands from visual ways to hook them and record the modification that happened.

00sapo commented

A solution is mapping . in visual and serendipity modes to a function that repeats the last edit command and then puts the . register. The options should then have a list of "edit" commands that are hooked for remembering them...

00sapo commented

Thanks to Matrix user, for getting last edit command:

local ffi = require('ffi')
ffi.cdef('char *get_inserted(void)')
function GetInserted() return ffi.string(ffi.C.get_inserted()) end

Which puts v before of the wanted command.

However, playing sequences of keys containing insert mode modifications is not possible with current neovim.

See neovim/neovim#19086 and #7

00sapo commented

12a9f10 and 12a9f10 partially fix this issue for edit commands. Non-edit commands are not supported by <A-,>. Repeating commands from normal mode works as usual via .