-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using ZkNew
from within a zk-buffer.
#192
Comments
I just ran If they're working from a non-zk buffer then ... I'm confused. Would've expected it to at least be the other way around. I would ask you to fully close all running instances of neovim, navigate to the root dir of your notebook, and try again. What happens if you just run |
Also, there have been a few changes since your |
Running |
Ok, I've updated the zk to version |
Have you tried in a completely fresh notebook with a completely fresh terminal session? It works for me: https://asciinema.org/a/GNLkLwdTYVDWVRiCqNFh4sJjW If I run the command in a non-zk buffer the note gets created in my main global zk (as I have |
Hmmm. It's occurred to me now. You're on nvim 0.9. The neovim api for getting the active clients changed between 0.9 and 0.10. We created a conditional check for that though: #167 But maybe it's not playing nice. |
I also encountered the same error as @blastmaster. I temporarily fixed it by using a Lua function to assign a keymap as follows: Sorry for my poor English. |
@ngocdotnt So your command only works when replacing |
|
Reading this again fresh. It sounds like the culprit could be how you're loading your keybinds. I see that they're not being loaded via The way to test would be to create a singular keybind in on attach that just creates a new note. Then iterate from there. on_attach = function()
vim.keymap.set('n', '<leader>zn', '<cmd>ZkNew<cr>')
end, |
Check if applicable
Describe the bug
When executing
ZKNew
commands from inside an zk-buffer in Neovim I'll get an error.E488: Trailing characters:
The command works fine from any other buffer or a fresh neovim session without any file open.
How to reproduce?
:ZkNew
with some args.No matter if I try to create a new Note using a keymap like that from your Readme:
map("n", "<leader>zn", "<Cmd>ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>", opts)
or doing things by hand like
:ZkNew { dir = "journal", date = "today" }
.I'll get the error:
E488: Trailing characters: { dir = "journal", date = "today" }
The same commands and or keymaps work when using them from an non-zk buffer.
zk configuration
Neovim configuration
Environment
The text was updated successfully, but these errors were encountered: