summaryrefslogtreecommitdiff
path: root/lua/core/terminal.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-10-03 14:32:09 +0200
committerGitHub <[email protected]>2021-10-03 14:32:09 +0200
commit3e1cd1ec235404ae96ed2d0756729cf44ae48f3e (patch)
tree227eeed96eb96db68840fceab3aa39f77066dc2b /lua/core/terminal.lua
parentfe6e7591d8f8a75cad9725e03a9528608e0c21f9 (diff)
fix: add missing lsp.log entry in log_viewer (#1666)
Diffstat (limited to 'lua/core/terminal.lua')
-rw-r--r--lua/core/terminal.lua26
1 files changed, 2 insertions, 24 deletions
diff --git a/lua/core/terminal.lua b/lua/core/terminal.lua
index 418dc2c4..3a0c6e46 100644
--- a/lua/core/terminal.lua
+++ b/lua/core/terminal.lua
@@ -1,5 +1,4 @@
local M = {}
-local utils = require "utils"
local Log = require "core.log"
M.config = function()
@@ -90,29 +89,9 @@ M._exec_toggle = function(exec)
exec_term:toggle()
end
-local function get_log_path(name)
- --handle custom paths not managed by Plenary.log
- local file
- if name == "nvim" then
- file = utils.join_paths(vim.fn.stdpath "cache", "log")
- elseif name == "packer.nvim" then
- file = utils.join_paths(vim.fn.stdpath "cache", "packer.nvim.log")
- else
- file = Log:get_path()
- end
- if utils.is_file(file) then
- return file
- end
-end
-
---Toggles a log viewer according to log.viewer.layout_config
----@param name can be the name of any of the managed logs, e,g. "lunarvim" or the default ones {"nvim", "lsp", "packer.nvim"}
-M.toggle_log_view = function(name)
- local logfile = get_log_path(name)
- if not logfile then
- return
- end
-
+---@param logfile string the fullpath to the logfile
+M.toggle_log_view = function(logfile)
local log_viewer = lvim.log.viewer.cmd
if vim.fn.executable(log_viewer) ~= 1 then
log_viewer = "less +F"
@@ -129,7 +108,6 @@ M.toggle_log_view = function(name)
local Terminal = require("toggleterm.terminal").Terminal
local log_view = Terminal:new(term_opts)
- -- require("core.log"):debug("term", vim.inspect(term_opts))
log_view:toggle()
end