00sapo/visual.nvim

Macro do not work

Closed this issue · 3 comments

00sapo commented
Macro do not work
00sapo commented

Likely connected issue: neovim/neovim#19086

00sapo commented

Possible function:

function PlayMacro(reg)
	local Vdbg = require("visual.debugging")

	local content = vim.fn.getreg(reg)
	Vdbg("Got register " .. reg .. ": " .. content)
	for c in content:gmatch(".") do
                Vdbg("Sending character " .. c .. " to macro; mode: " .. vim.fn.mode())
		vim.fn.feedkeys(c, "mx") -- here, "x" always leaves editor in normal mode, but not using it, causes asynchronous behavior which causes non-mapped keys being played first
	end
end
00sapo commented

closing for now, as cannot be solved. For now, fb17c53 introduces automatic disabling of visual.nvim when playing with macros (must be re-enabled manually via :VisualEnable)