commit 859d7d5b2361bf05b9b7533ccd2452f2296f16b5
parent 3e734f8fda644a9f50d68c083427cd1182aef772
Author: Thomas Vigouroux <tomvig38@gmail.com>
Date: Mon, 8 Nov 2021 11:42:39 +0100
fix(zest): add guards to avoid error
Diffstat:
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/after/ftplugin/markdown.lua b/after/ftplugin/markdown.lua
@@ -2,6 +2,7 @@ vim.cmd[[setlocal textwidth=70]]
vim.cmd[[setlocal nowrap]]
vim.cmd[[compiler mdpdf]]
+if vim.fn.executable 'zest' == 0 then return end
if #(vim.fn.system{ 'zest', 'search', string.format('file:%s', vim.fn.expand"%:p")}) ~= 0 then
vim.api.nvim_buf_set_keymap(0, 'n', '<Leader>r', '<cmd>ZestRefs<CR>', { noremap=true, silent=true })
diff --git a/init.lua b/init.lua
@@ -1,6 +1,10 @@
local M = {}
-require'impatient'.enable_profile()
+local ok, imp = pcall(require, 'impatient')
+
+if ok then
+ imp.enable_profile()
+end
vim.g.python_host_prog = "/bin/python"
diff --git a/plugin/zest.lua b/plugin/zest.lua
@@ -2,6 +2,10 @@ local api = vim.api
local M = {}
+if vim.fn.executable('zest') == 0 then
+ return
+end
+
local function zest(...)
return vim.fn.systemlist{'zest', ...}
end