fix: can't open lvim log file cause by lvim.log.viewer.cmd (#1638)

This commit is contained in:
Xavier Young 2021-09-30 13:42:10 +08:00 committed by GitHub
parent 94a166594e
commit 35d5615ecc
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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