From f19ae0487bdd42eaf884d5203e2ae0ef5be03a5e Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 17 Oct 2024 10:55:18 +0200 Subject: [PATCH] specify conditions to re-enable diagnostics after git conflict --- lua/custom/plugins/conflictmarker.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/conflictmarker.lua b/lua/custom/plugins/conflictmarker.lua index 797b02c..9606fc3 100644 --- a/lua/custom/plugins/conflictmarker.lua +++ b/lua/custom/plugins/conflictmarker.lua @@ -24,9 +24,10 @@ return { local beginning = vim.fn.match(lines, vim.g.conflict_marker_begin) local ending = vim.fn.match(lines, vim.g.conflict_marker_end) local enabled = vim.diagnostic.is_enabled() - if (beginning > -1 or ending > -1) and enabled then + local conflict = beginning > -1 or ending > -1 + if conflict and enabled then vim.diagnostic.enable(false) - elseif not enabled then + elseif not conflict and not enabled then vim.diagnostic.enable(true) end end