Skip to content

Commit 8e504ca

Browse files
authored
fix(loader): check pack exists before apply color (#207)
1 parent 42f896d commit 8e504ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lua/colorbox/loader.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local logging = require("colorbox.commons.logging")
22
local strings = require("colorbox.commons.strings")
33
local tables = require("colorbox.commons.tables")
4+
local uv = require("colorbox.commons.uv")
45

56
local configs = require("colorbox.configs")
67

@@ -17,6 +18,10 @@ M.load = function(colorname)
1718
if tables.tbl_empty(spec) then
1819
return
1920
end
21+
local pack_exist = uv.fs_stat(spec.full_pack_path) ~= nil
22+
if not pack_exist then
23+
return
24+
end
2025

2126
local autoload_path = string.format("%s/autoload", spec.full_pack_path)
2227
vim.opt.runtimepath:append(autoload_path)

0 commit comments

Comments
 (0)