Skip to content

Commit a751b92

Browse files
committed
fix(lightbulb): wrong lnum in get
1 parent 2303d67 commit a751b92

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/lspsaga/codeaction/lightbulb.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ local function diagnostic_vim_to_lsp(diagnostics)
8787
return {
8888
range = {
8989
start = {
90-
line = diagnostic.lnum,
90+
line = diagnostic.lnum + 1,
9191
character = diagnostic.col,
9292
},
9393
['end'] = {
94-
line = diagnostic.end_lnum,
94+
line = diagnostic.end_lnum + 1,
9595
character = diagnostic.end_col,
9696
},
9797
},
@@ -108,7 +108,7 @@ local function render(bufnr)
108108
local row = api.nvim_win_get_cursor(0)[1] - 1
109109
local params = lsp.util.make_range_params()
110110
params.context = {
111-
diagnostics = diagnostic_vim_to_lsp(vim.diagnostic.get(bufnr, { lnum = row + 1 })),
111+
diagnostics = diagnostic_vim_to_lsp(vim.diagnostic.get(bufnr, { lnum = row })),
112112
}
113113

114114
lsp.buf_request(bufnr, 'textDocument/codeAction', params, function(_, result, _)

0 commit comments

Comments
 (0)