Skip to content

Commit

Permalink
fix: rearrange extmarks.clear
Browse files Browse the repository at this point in the history
  • Loading branch information
rachartier committed Jan 12, 2025
1 parent 552b814 commit dbc6dbc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lua/tiny-inline-diagnostic/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ local virtual_text_forge = require("tiny-inline-diagnostic.virtual_text")
local extmarks = require("tiny-inline-diagnostic.extmarks")
local timers = require("tiny-inline-diagnostic.timer")

-- Constants
local AUGROUP_NAME = "TinyInlineDiagnosticAutocmds"
local USER_EVENT = "TinyDiagnosticEvent"
local USER_EVENT_THROTTLED = "TinyDiagnosticEventThrottled"
local DISABLED_MODES = { "i", "v", "V", "" }
local DISABLED_MODES = { "i", "v", "V" }

-- State
M.enabled = true
M.user_toggle_state = true
local attached_buffers = {}
Expand All @@ -21,7 +19,6 @@ local attached_buffers = {}
---@field line number
---@field col number

-- Core enable/disable functions
local function enable()
M.enabled = true
vim.api.nvim_exec_autocmds("User", { pattern = USER_EVENT })
Expand Down Expand Up @@ -229,11 +226,10 @@ local function setup_mode_change_autocmds(autocmd_ns, event)

if vim.tbl_contains(DISABLED_MODES, mode) then
disable()
extmarks.clear(event.buf)
else
enable()
end

extmarks.clear(event.buf)
end,
})
end
Expand Down

0 comments on commit dbc6dbc

Please sign in to comment.