install: error if plugin installed incorrectly
This commit is contained in:
parent
f0547c5a9f
commit
770e0d5171
1 changed files with 14 additions and 3 deletions
|
|
@ -33,13 +33,24 @@ M.config = {
|
||||||
}
|
}
|
||||||
|
|
||||||
M.setup = function(user_config)
|
M.setup = function(user_config)
|
||||||
|
M.script_path = vim.fn.fnamemodify(debug.getinfo(1).source:sub(2), ':h:h')
|
||||||
|
.. '/import-cost/index.js'
|
||||||
|
|
||||||
|
if not vim.loop.fs_stat(M.script_path) then
|
||||||
|
vim.notify_once(
|
||||||
|
string.format(
|
||||||
|
'import-cost.nvim: Failed to load script at %s. Ensure the plugin is properly installed.',
|
||||||
|
M.script_path
|
||||||
|
),
|
||||||
|
vim.log.levels.ERROR
|
||||||
|
)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
M.config = vim.tbl_deep_extend('force', M.config, user_config or {})
|
M.config = vim.tbl_deep_extend('force', M.config, user_config or {})
|
||||||
|
|
||||||
M.ns_id = vim.api.nvim_create_namespace 'ImportCost'
|
M.ns_id = vim.api.nvim_create_namespace 'ImportCost'
|
||||||
|
|
||||||
M.script_path = vim.fn.fnamemodify(debug.getinfo(1).source:sub(2), ':h:h')
|
|
||||||
.. '/import-cost/index.js'
|
|
||||||
|
|
||||||
vim.api.nvim_set_hl(
|
vim.api.nvim_set_hl(
|
||||||
0,
|
0,
|
||||||
'ImportCostVirtualText',
|
'ImportCostVirtualText',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue