rmagatti / goto-preview

A small Neovim plugin for previewing definitions using floating windows.
Apache License 2.0
835 stars 27 forks source link

Getting "Invalid key" error when go to definition #94

Closed proivk closed 1 year ago

proivk commented 1 year ago

Describe the bug Error message each time I go to definition.

To Reproduce Steps to reproduce the behavior:

  1. Open file (*.go file in my case)
  2. gpd on some method or variable

Expected behavior Pop up window with definition of method or variable

Screenshots

Error executing vim.schedule lua callback: .../pack/packer/start/goto-preview/lua/goto-preview/lib.lua:115: invalid key: title
stack traceback:
        [C]: in function 'nvim_open_win'
        .../pack/packer/start/goto-preview/lua/goto-preview/lib.lua:115: in function 'open_floating_win'
        .../pack/packer/start/goto-preview/lua/goto-preview/lib.lua:253: in function 'handle'
        .../pack/packer/start/goto-preview/lua/goto-preview/lib.lua:284: in function 'handler'
        ...w/Cellar/neovim/0.8.3/share/nvim/runtime/lua/vim/lsp.lua:1383: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Baseline (please complete the following information):

Additional context gpr works well though. gpi do nothing

rmagatti commented 1 year ago

Oh, I suppose the new title feature is only on nightly. I'll add some code to make it backwards compatible. Thanks for flagging

rmagatti commented 1 year ago

Mind testing out the branch in the linked PR @proivk ?

fangjunzhou commented 1 year ago

Mind testing out the branch in the linked PR @proivk ?

I have the same issue, I'll can test the PR branch latter.

fangjunzhou commented 1 year ago

The PR branch solves this issue. But I have a question unrelated to this issue: Can I open the previewed position in the current window?

rmagatti commented 1 year ago

Thanks for testing it out, I've replied to your question in the linked issue.

proivk commented 1 year ago

Works perfectly. Thank you!