Skip to content
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

Doc: ZkNotes match requires a dictionary to be passed in instead of a string #89

Closed
ingram1107 opened this issue Dec 12, 2022 · 0 comments · Fixed by #90
Closed

Doc: ZkNotes match requires a dictionary to be passed in instead of a string #89

ingram1107 opened this issue Dec 12, 2022 · 0 comments · Fixed by #90

Comments

@ingram1107
Copy link
Contributor

In the section of Example Mappings from README.md and zk-nvim's vim help file:

-- Search for the notes matching a given query.
vim.api.nvim_set_keymap("n", "<leader>zf", "<Cmd>ZkNotes { sort = { 'modified' }, match = vim.fn.input('Search: ') }<CR>", opts)

However, with the above config, the LSP client will complain about failing to parse the arguments:

Error executing vim.schedule lua callback: ...cal/share/nvim/site/pack/packer/start/zk-nvim/lua/zk.lua:101: RPC[Error] code_name = InvalidRequest, message = "failed to parse
zk.tag.list args, got: map[match: select:[title absPath path] sort:[modified]]: json: cannot unmarshal string into Go struct field cmdListOpts.match of type []string"
stack traceback:
        [C]: in function 'assert'
        ...cal/share/nvim/site/pack/packer/start/zk-nvim/lua/zk.lua:101: in function 'handler'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1383: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Which is certainly caused by an api update on the upstream. The documentation should be updated as follows:

vim.api.nvim_set_keymap("n", "<leader>zf", "<Cmd>ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }<CR>", opts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant