summary refs log tree commit diff
path: root/.vim/lua
diff options
context:
space:
mode:
Diffstat (limited to '.vim/lua')
-rw-r--r--.vim/lua/plugins.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/.vim/lua/plugins.lua b/.vim/lua/plugins.lua
index 86ae9f5..c29d2c2 100644
--- a/.vim/lua/plugins.lua
+++ b/.vim/lua/plugins.lua
@@ -1012,12 +1012,15 @@ require('packer').startup({function()
         return {
           type = 'text',
           val = function()
-            local j = require('plenary.job'):new({
+            local Job = require('plenary.job')
+            local ok, j = pcall(Job.new, Job, {
               command = 'fortune',
               args = {vim.env.HOME..'/devel/projects/zig/fortune/fortunes'},
               enable_recording = true,
             })
-            local lines = j:sync()
+            if not ok then return {} end
+                  local lines, exit_code = j:sync()
+            if not exit_code == 0 then return {} end
             local new = {}
             for i = 1, #lines do
               if not (vim.trim(lines[i]) == '') then