Skip to content

Commit

Permalink
feat(diagnostic): set column position to first non-whitespace (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottming authored Apr 10, 2023
1 parent 734efe8 commit 2872401
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/neotest/consumers/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ local function init(client)
{}
)
local mark_code = api.nvim_buf_get_lines(bufnr, mark[1], mark[1] + 1, false)[1]

if mark_code == self.error_code_lines[pos_id][error_i] then
diagnostics[#diagnostics + 1] = {
lnum = mark[1],
col = 0,
col = mark_code:find("%S") - 1,
message = error.message,
source = "neotest",
severity = config.diagnostic.severity,
Expand Down

0 comments on commit 2872401

Please sign in to comment.