mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-25 12:51:45 +00:00
specify conditions to re-enable diagnostics after git conflict
This commit is contained in:
parent
5febea0f8a
commit
f19ae0487b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user