Merge pull request #59 from asbjornhaland/save

fix(mark): move early exit after saving
This commit is contained in:
ThePrimeagen 2021-04-21 08:30:54 -06:00 committed by GitHub
commit 8b785eafe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,14 +9,14 @@ local callbacks = {}
-- I am trying to avoid over engineering the whole thing. We will likely only
-- need one event emitted
local function emit_changed()
if not callbacks["changed"] then
return
end
if harpoon.get_global_settings().save_on_change then
harpoon.save()
end
if not callbacks["changed"] then
return
end
for _, cb in pairs(callbacks) do
cb()
end