Open sandangel opened 2 years ago
hmmm can you share how you've bind it.
require'lspsaga.action'.smart_scroll_with_saga(1, '<c-d>')
require'lspsaga.action'.smart_scroll_with_saga(-1, '<c-u>')
works for me
@tami5 sorry my lspconfig was a bit long, the binding is included in the issue description, but I will put it here:
local opts = { silent = true, buffer = bufnr }
vim.keymap.set('n', '<c-f>', "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1, '<c-f>')<cr>", opts)
vim.keymap.set('n', '<c-b>', "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1, '<c-b>')<cr>", opts)
this is what I have when running :verbose map <c-f>
n <C-F> *@<Cmd>lua require('lspsaga.action').smart_scroll_with_saga(1, '<C-F>')<CR>
Last set from Lua
hmmm thats odd, the issue is here
if current_win_lnum >= last_lnum then
current_win_lnum = last_lnum - 1
end
so this function scroll_in_win is called by multiple provider, does this happen when you want to scroll hover?, some how last_num isn't set by the caller, which can be a bug
Hi @tami5 , thanks for taking a look. the smart scroll does not work in all lspsaga windows (hover, preview definition...) (nothing happens), but only the scroll in lsp finder generate the error
but only the scroll in lsp finder generate the error
Oh, I see, I was wondering why I didn't experience this error. unfortunately this is the one thing I kept but haven't been using, there are many open issues regarding lsp finder and I recommend replacing with something like telescope lsp_* . feel free to continue debugging if you found a solution please open a pr.
@tami5 but the normal smart scroll command do not work on other lspsaga windows too. (hover, preview definition) 😭
hmmm
this is what I have when running
:verbose map <c-f>
n <C-F> *@<Cmd>lua require('lspsaga.action').smart_scroll_with_saga(1, '<C-F>')<CR> Last set from Lua
Maybe the way the command is set?
n <C-D> * <Cmd>lua require'lspsaga.action'.smart_scroll_with_saga(1, '<C-D>')<CR>
Last set from Lua
mine doesn't have @
it's because i set them in with buffer option. I also set them without buffer option but it doesn't work. Is there a way to jump to the lspsaga window? I can scroll from there. I tried with <C-w>W
or <C-w><C-w>
but the window only closes.
it's because i set them in with buffer option. I also set them without buffer option but it doesn't work. Is there a way to jump to the lspsaga window? I can scroll from there. I tried with
<C-w>W
or<C-w><C-w>
but the window only closes.
I'm also setting it using buffer, try using old vim api vim.cmd'nmap <buffer>...'
for hovers you can double hover to jump to it, others not sure.
for hovers you can double hover to jump to it, others not sure.
hi @tami5 , can we make it work the same for other windows? like jumping to the window that we need to scroll when we hit the keymap again when that window is opened?
I tried with old vim api but it also didn't work
Description
Hi, I got this error when trying to execute keymap for lspsaga smart scroll
Expected Behavior
It should scroll the window up/down
Actual Behavior
It showed the error above
Neovim Built in Behavior
Neovim doesn't have this built in AFAIK
Details
Reproduce
lspconfig.lua ```lua local root_pattern = require('lspconfig.util').root_pattern local lspconfig = require 'lspconfig' local capabilities = require('plugins.configs.cmp').capabilities vim.lsp.set_log_level 'error' vim.diagnostic.config { virtual_text = { prefix = '', }, signs = true, underline = true, update_in_insert = false, } local opts = { silent = true } vim.keymap.set('n', '[d', 'Environment
```sh NVIM v0.8.0-dev Build type: Release LuaJIT 2.1.0-beta3 Compiled by nixbld Features: +acl +iconv +tui See ":help feature-compile" system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: " /nix/store/rvillp8grvwp6cx1qkwayd4x3jwwsgf2-neovim-unwrapped-master/share/nvim " Run :checkhealth for more info ``` Linux NixOS 22.05