From 78417901cb1ba2093c3c13b6e978b38f5315f700 Mon Sep 17 00:00:00 2001 From: Keita Suzuki Date: Mon, 22 Jan 2024 14:49:34 +0900 Subject: [PATCH] Fix: stop showing get_diagnostic when cursor exceed position This patch fixes the problem which diagnostics keeps on showing even when cursor position exceeds diagnosed area in get_diagnostic. It fixes the condition clause in get_diagnostic to correctly determine the cursor position to show. This is a followup fix from Issue #1270. --- lua/lspsaga/diagnostic/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lspsaga/diagnostic/init.lua b/lua/lspsaga/diagnostic/init.lua index 53e01b4c1..5ee737abd 100644 --- a/lua/lspsaga/diagnostic/init.lua +++ b/lua/lspsaga/diagnostic/init.lua @@ -52,7 +52,7 @@ function diag:get_diagnostic(opt) if opt.cursor then local res = {} for _, v in pairs(entrys) do - if v.col <= col and (v.end_col and v.end_col > col or true) then + if v.col <= col and (not v.end_col or v.end_col > col) then res[#res + 1] = v end end