summaryrefslogtreecommitdiff
path: root/lua/core/terminal.lua
diff options
context:
space:
mode:
authorXavier Young <[email protected]>2021-09-30 13:42:10 +0800
committerGitHub <[email protected]>2021-09-30 07:42:10 +0200
commit35d5615ecc2366ec5de4ce0fecd75fb426216ea0 (patch)
treef9dd6536b4346d3aad71ced97a1df365368b51d4 /lua/core/terminal.lua
parent94a166594e9e4913a0b89f6bfd400c536a596dd4 (diff)
fix: can't open lvim log file cause by `lvim.log.viewer.cmd` (#1638)
Diffstat (limited to 'lua/core/terminal.lua')
-rw-r--r--lua/core/terminal.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/core/terminal.lua b/lua/core/terminal.lua
index 4525ca63..418dc2c4 100644
--- a/lua/core/terminal.lua
+++ b/lua/core/terminal.lua
@@ -112,8 +112,14 @@ M.toggle_log_view = function(name)
if not logfile then
return
end
+
+ local log_viewer = lvim.log.viewer.cmd
+ if vim.fn.executable(log_viewer) ~= 1 then
+ log_viewer = "less +F"
+ end
+ log_viewer = log_viewer .. " " .. logfile
local term_opts = vim.tbl_deep_extend("force", lvim.builtin.terminal, {
- cmd = lvim.log.viewer.cmd .. " " .. logfile,
+ cmd = log_viewer,
open_mapping = lvim.log.viewer.layout_config.open_mapping,
direction = lvim.log.viewer.layout_config.direction,
-- TODO: this might not be working as expected