fix(#1632): autocenter: avoid use of feedkeys (#1632)

This commit is contained in:
emmanueltouzery
2022-10-15 02:10:42 +02:00
committed by GitHub
parent 6ff828b25b
commit 187388b7f5

View File

@@ -391,9 +391,11 @@ local function setup_autocommands(opts)
create_nvim_tree_autocmd("BufEnter", {
pattern = "NvimTree_*",
callback = function()
local bufnr = api.nvim_get_current_buf()
vim.schedule(function()
local keys = api.nvim_replace_termcodes("zz", true, false, true)
api.nvim_feedkeys(keys, "n", true)
api.nvim_buf_call(bufnr, function()
vim.cmd [[norm! zz]]
end)
end)
end,
})