From 28724010861dbf294f09b9ee1948d2da2823604b Mon Sep 17 00:00:00 2001 From: Scott Ming Date: Mon, 10 Apr 2023 18:15:10 +0800 Subject: [PATCH] feat(diagnostic): set column position to first non-whitespace (#231) --- lua/neotest/consumers/diagnostic.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/neotest/consumers/diagnostic.lua b/lua/neotest/consumers/diagnostic.lua index 7c84ee24..cb16be96 100644 --- a/lua/neotest/consumers/diagnostic.lua +++ b/lua/neotest/consumers/diagnostic.lua @@ -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,