Closed mareksubocz closed 2 years ago
No keymap yet. It is a non-focusable floating window. Not sure how it may works.
I see, no problem.
What do you mean then by "Scroll in side signature window" mentioned in the repo?
Sorry. It was supported in early versions when I used a different api. The document is not accurate. I updated the doc.
No keymap yet. It is a non-focusable floating window. Not sure how it may works.
is it possible to use nvim_win_set_cursor
for this?
https://github.com/ray-x/lsp_signature.nvim/commit/9d71bb16457b361801e222bdbfe4fb7aeb30c2cb
Once you jump to floating window, you can define move_cursor_key
to jump to floating window. and using pageup/down to scroll.
It does not support keymaps in normal mode. As it will close the floating win.
@ray-x Hey. Thanks for this plugin :) I really think this should be a feature that is there out of the box. Many times documentations cannot be seen because it is cut off. For example, this happens to almost all the nvim lua documentations:
It is not hard to implement this feature. In fact, I have done something similar already:
local function escape_term_codes(str)
return vim.api.nvim_replace_termcodes(str, true, false, true)
end
local function is_float_open(window_id)
return window_id and window_id ~= 0 and vim.api.nvim_win_is_valid(window_id)
end
local function scroll_float(mapping)
-- Using the global config of the lsp_signature plugin
local window_id = _G._LSP_SIG_CFG.winnr
if is_lsp_float_open(window_id) then
vim.fn.win_execute(window_id, 'normal! ' .. mapping)
end
end
local map = vim.keymap.set
local opts = { noremap = true, silent = true }
local scroll_up_mapping = escape_term_codes('<c-u>')
local scroll_down_mapping = escape_term_codes('<c-d>')
map('i', '<c-u>', function() scroll_float(scroll_up_mapping) end, opts)
map('i', '<c-d>', function() scroll_float(scroll_down_mapping) end, opts)
Also, there is no scrollbar in the signature help, which I think is crucial to have, in order to even know that there is any documentation below the currently visible area. Otherwise, one would not even notice that. Something similar to the pum scrollbar would be nice. Many plugins do such a thing, for example nvim-cmp
shows the scrollbar both in the completion and documentation window:
One can scroll through the documentation window by using the nvim-cmp
config:
local map = require('cmp').mapping
require('cmp').setup({
mapping = map.preset.insert({
['<c-d>'] = map.scroll_docs(5),
['<c-u>'] = map.scroll_docs(-5),
}),
})
So please add this feature, it would be great! :)
Hello, love your plugin :D I have just one question, when docs are displayed, how do you scroll down/up if they are longer that window length? Also, is it possible to remap to a keybind of choice?