Skip to content

Commit e4c47d2

Browse files
committed
fix(blink): Attempt to get dynamic source list for blink.cmp
Ref: #317
1 parent f9f80ec commit e4c47d2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

plugin/markview.lua

+12-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,18 @@ if vim.g.markview_blink_loaded == false and blink ~= nil then
6565
if config then
6666
--- ISSUE, blink doesn't merge default sources.
6767

68-
local default = config.sources.default or {};
69-
config.sources.per_filetype[ft] = vim.list_extend(default, { "markview" });
68+
local default = config.sources.default;
69+
70+
if vim.islist(default) then
71+
config.sources.per_filetype[ft] = vim.list_extend(default, { "markview" });
72+
else
73+
--- Empty context.
74+
local can_exec, exec = pcall(default, {});
75+
76+
if can_exec and vim.islist(exec) then
77+
config.sources.per_filetype[ft] = vim.list_extend(exec, { "markview" });
78+
end
79+
end
7080
else
7181
pcall(blink.add_filetype_source, ft, "markview");
7282
end

0 commit comments

Comments
 (0)