lewis6991 / hover.nvim

Hover plugin framework for Neovim
MIT License
516 stars 35 forks source link

hover.hover() position is off by 1 #45

Closed flrgh closed 11 months ago

flrgh commented 11 months ago

Hiya :wave:

Today after updating the plugin to bb3dc1a9fa34c3577bca627b848625e94a93efe8 I noticed that require("hover").hover() yields a result for $current_line + 1 instead of $current_line:

Screenshot from 2023-11-11 13-49-54

Screenshot from 2023-11-11 13-50-05

Here is my lazy.nvim package def and config for hover.nvim:

{
  "lewis6991/hover.nvim",
  event = "VeryLazy",
  config = function()
    require("hover").setup({
      init = function()
        require("hover.providers.lsp")
        require("hover.providers.man")
        require("hover.providers.gh")
      end,
      preview_opts = {
        border = nil,
      },
      title = true,
    })
  end,
}

...and I have a normal mode keymap for K which just calls require("hover").hover(). I can also reproduce the problem by running this without the keymap (e.g. :lua require("hover").hover()).

All of my other LSP mappings (definition, declaration, code-action, etc all work normally) are working fine.

Reverting to 24369e8595736077e30b3ca5fc233f44abeccb8b fixes the problem, so I suspect that there might be some unintentional breakage from these two recent commits

I'll try to writeup a minimal repro config when time permits. If there's anything else I can do to help troubleshoot in the meantime, lemme know!

lewis6991 commented 11 months ago

No repro necessary. Should be easy to fix.

AThePeanut4 commented 11 months ago

My PR #44 fixes this.

lewis6991 commented 11 months ago

Closed in https://github.com/lewis6991/hover.nvim/commit/3ff5bbb19f8191a77ff7fc15b8646cbd68314360