lewis6991 / lewis6991/hover.nvim
how to prevent the `No result` popup from appearing?
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 744
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
i just found out about this plugin yesterday, and copied the config from the readme into my init.lua and i believe things are working as they should. however if i move my mouse / cursor to a part of the screen where there is no text i begin to see a popup that states No result
for example moving my mouse to the part of the screen as seen in the picture below, and letting the mouse sit there for say 1 second the popup / hover appears with the text,
LSP[lua_ls]
No result
is there way to prevent this popup but still keep the standard behavior? ideally i'd like to see the diagnostic messages when hovering my mouse over a particular part of the file where a diagnostic message is present.
i searched the github issues open and closed and only 2 issues came back when searching for no result and they did not seem to be related from what i can tell.
and my basic configuration i have in my init.lua looks like the below,
---------------
-- PLUGIN / hover.nvim
-- https://github.com/lewis6991/hover.nvim
----
require('hover').config({
-- list of module names to load as providers
--- @type (string|Hover.config.Provider)[]
providers = {
'hover.providers.diagnostic',
'hover.providers.lsp',
'hover.providers.dap',
'hover.providers.man',
'hover.providers.dictionary',
},
preview_opts = {
border = 'single'
},
-- Whether the contents of a currently open hover window should be moved
-- to a :h preview-window when pressing the hover keymap.
preview_window = false,
title = true,
mouse_providers = {
'hover.providers.lsp',
},
mouse_delay = 1000,
mouse_providers ={
'hover.providers.lsp'
}
})
vim.o.mousemoveevent = true
-- setup the mouse hover keymap
vim.keymap.set('n', '<MouseMove>', function()
-- NOWORK!
-- only trigger hover if we're over an identifier / keyword
local char = vim.fn.getline('.'):sub(vim.fn.col('.'), vim.fn.col('.'))
if not char:match('[%w_]') then
return
end
-- NOWORK!
-- this call internally runs providers and only shows a popup if a result is found
require('hover').mouse()
end, { desc = 'hover.nvim (mouse)' })
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the init.lua configuration and the require('hover').mouse() entry point shown in the report, then reproduce the popup with vim.o.mousemoveevent enabled and the listed mouse provider. Trace when the LSP provider returns no result and verify that the unwanted popup is suppressed while diagnostic hover still appears over diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100