commit 3abd2a9de9bf865d626c02c890afa7dfe80b7beb
parent 358c89efad0131acaa283b25393740773ec11e5f
Author: Tomas Nemec <nemi@skaut.cz>
Date: Mon, 9 Aug 2021 10:44:07 +0200
fix(trun-status): status failed before return content
Diffstat:
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/trun-status.lua b/tools/trun-status.lua
@@ -28,7 +28,5 @@ for _, status_file_name in ipairs(status_files) do
local status_file = io.open(status_file_path, 'r')
local status = status_file:read('*a')
io.write(status, '\n')
- else
- os.exit(1)
end
end
diff --git a/tools/trun_to_neovim_quickfix.lua b/tools/trun_to_neovim_quickfix.lua
@@ -10,8 +10,9 @@
--
-- returns list of running truns
local complete = function()
- local dir = os.getenv('TRUN_STATUS_DIR') or os.getenv('XDG_CACHE_HOME') .. '/trun'
- local ls = io.popen('ls ' .. dir)
+ local status_dir_def = os.getenv('XDG_CACHE_HOME') .. '/trun'
+ local status_dir = os.getenv('TRUN_STATUS_DIR') or status_dir_def
+ local ls = io.popen('ls ' .. status_dir)
local truns = {}
for trun in ls:lines() do
local name = trun:match('(.*)%..*')
@@ -27,7 +28,8 @@ local to_qf = function(name)
return
end
vim.fn.setqflist({}, 'r')
- local handle = io.popen('trun_status - ' .. name)
+ -- Depends on `trun-status` viz->tools/trun-status.lua
+ local handle = io.popen('trun-status ' .. name)
local o = {}
for line in handle:lines() do
table.insert(o, line)
@@ -61,4 +63,4 @@ fun! TrunComplete(A,L,P)
return v:lua.Trun.complete()
endfun
]]
-vim.cmd [[command! -nargs=1 -complete=customlist,TrunComplete Trunqf v:lua.Trun.qf("<args>")]]
+vim.cmd [[command! -nargs=1 -complete=customlist,TrunComplete Trunqf lua Trun.qf("<args>")]]