Skip to content

Commit

Permalink
fix: icorrect row/line in diagnostics. Fixes #264
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Feb 19, 2023
1 parent cf77ee5 commit 32fa4ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/trouble/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ function M.process_item(item, bufnr)
local range = item.range or item.targetSelectionRange

local start = {
line = range and vim.tbl_get(range, "start", "line") or item.col,
character = range and vim.tbl_get(range, "start", "character") or item.lnum,
line = range and vim.tbl_get(range, "start", "line") or item.lnum,
character = range and vim.tbl_get(range, "start", "character") or item.col,
}
local finish = {
line = range and vim.tbl_get(range, "end", "line") or item.end_col,
character = range and vim.tbl_get(range, "end", "character") or item.end_lnum,
line = range and vim.tbl_get(range, "end", "line") or item.end_lnum,
character = range and vim.tbl_get(range, "end", "character") or item.end_col,
}

if start.character == nil or start.line == nil then
Expand Down

0 comments on commit 32fa4ed

Please sign in to comment.