auto-pandoc.nvim icon indicating copy to clipboard operation
auto-pandoc.nvim copied to clipboard

Getting error on attempting to run pandoc

Open vorboyvo opened this issue 1 year ago • 5 comments

This is my lazy.nvim config snipper setting up auto-pandoc:

{
	'jghauser/auto-pandoc.nvim',
	dependencies = { 'nvim-lua/plenary.nvim' },
	ft = "markdown",
	config = function()
		vim.api.nvim_create_autocmd("BufEnter", {
			pattern = "*.md",
			callback = function()
				vim.keymap.set("n", "go", function()
					require("auto-pandoc").run_pandoc()
				end, { silent = true, buffer = 0 })
			end,
			group = vim.api.nvim_create_augroup("setAutoPandocKeymap", {}),
			desc = "Set keymap for auto-pandoc",
		})
	end
},

When attempting to run Pandoc using "go", I get the following error:

Error executing luv callback:
vim/_editor.lua:0: E5560: nvim_echo must not be called in a lua loop callback
stack traceback:
        [C]: in function 'nvim_echo'
        vim/_editor.lua: in function 'notify'
        ...cal/share/nvim/lazy/auto-pandoc.nvim/lua/auto-pandoc.lua:13: in function
 '_user_on_exit'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:240: in functio
n '_shutdown'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:47: in function
 <.../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:38>

Do I have something misconfigured? Is there any additional info I could/should provide?

vorboyvo avatar Feb 13 '24 12:02 vorboyvo

Thanks for the bug report! I don't have lazy.nvim, so I'm not quite sure what's going on here. The error does look familiar, I think there's something funny going on with the async code. I'll get back to you when I figure out more!

jghauser avatar Feb 16 '24 10:02 jghauser

I use lazy.vim, and configured the plugin with autocomand to load, just as you have, entered into a ~/.config/nvim/lual/plugins/plugins.lua file.

The only change ei made was to the command's keymap, in order to trigger the pandoc build command, as follows:

vim.keymap.set("n", "<leader>p", function()

I can reprt success.

plum avatar Feb 22 '24 22:02 plum

@plum, thanks for the feedback! Just to make sure, you're using the same config as @vibeisveryo (with only the keymap changed) and it works for you? @vibeisveryo, can you test whether this fixes it for you? I doubt it will, but it's good to rule it out!

jghauser avatar Feb 23 '24 08:02 jghauser

Doesn't work, sadly - I get the same error as before.

More relevant info, I figure, is that I'm running NixOS and configuring neovim through nix. Here's both my neovim.nix and the init.lua it references.

vorboyvo avatar Feb 23 '24 16:02 vorboyvo

@plum, thanks for the feedback! Just to make sure, you're using the same config as @vibeisveryo (with only the keymap changed) and it works for you? @vibeisveryo, can you test whether this fixes it for you? I doubt it will, but it's good to rule it out!

Yes that's right.

Nvim 0.9.5-2, with lazyvim , running on Ach Linux (linux-lts 6.6.17-1)

plum avatar Feb 23 '24 20:02 plum

Hey, I just did some housekeeping to allow me to maintain this plugin more easily and I fixed this issue while doing so. Sorry to take so long! :)

jghauser avatar Jul 08 '24 20:07 jghauser