Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Macro do not work #7

Closed
00sapo opened this issue Aug 5, 2023 · 3 comments
Closed

Macro do not work #7

00sapo opened this issue Aug 5, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@00sapo
Copy link
Owner

00sapo commented Aug 5, 2023

No description provided.

@00sapo 00sapo added the bug Something isn't working label Aug 5, 2023
@00sapo
Copy link
Owner Author

00sapo commented Aug 8, 2023

Likely connected issue: neovim/neovim#19086

@00sapo
Copy link
Owner Author

00sapo commented Aug 8, 2023

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
Copy link
Owner Author

00sapo commented Aug 30, 2023

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)

@00sapo 00sapo closed this as completed Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant