Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cursor position outside buffer error #294

Merged
merged 2 commits into from
Nov 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lua/lsp_signature/helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ helper.highlight_parameter = function(s, l)
end
if line == 1 then
-- scroll to top
vim.api.nvim_win_set_cursor(_LSP_SIG_CFG.winnr, { 2, 0 })
pcall(vim.api.nvim_win_set_cursor, _LSP_SIG_CFG.winnr, { 2, 0 })
end
if _LSP_SIG_CFG.bufnr and api.nvim_buf_is_valid(_LSP_SIG_CFG.bufnr) then
log('extmark', _LSP_SIG_CFG.bufnr, s, l, #_LSP_SIG_CFG.padding)
Expand Down Expand Up @@ -759,7 +759,7 @@ end
-- from vim.lsp.util deprecated function
helper.trim_empty_lines = function(lines)
local new_list = {}
for i, str in ipairs(lines) do
for _, str in ipairs(lines) do
if str ~= '' and str then
table.insert(new_list, str)
end
Expand Down
Loading