fix: avoid errors caused by echoing messages (#242)

This error below occurs when it takes long time to init the plugin.

E5560: nvim_echo must not be called in a lua loop callback
This commit is contained in:
JINNOUCHI Yasushi 2024-08-16 13:12:28 +09:00 committed by GitHub
parent 58c0089414
commit a7ebbb485d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,7 +47,7 @@ function Frecency:setup()
return done
end)
if not ok then
log.error("failed to setup:", status == -1 and "timed out" or "interrupted")
error("failed to setup:" .. (status == -1 and "timed out" or "interrupted"))
end
end
end