optimize: don't create lazygit term until toggle
This commit is contained in:
parent
ffde2ccc24
commit
4fd10f828e
|
|
@ -89,13 +89,16 @@ return {
|
||||||
'akinsho/toggleterm.nvim',
|
'akinsho/toggleterm.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
local Terminal = require('toggleterm.terminal').Terminal
|
local Terminal = require('toggleterm.terminal').Terminal
|
||||||
local lazygit = Terminal:new({
|
local lazygit = nil
|
||||||
cmd = "lazygit",
|
|
||||||
hidden = true,
|
|
||||||
direction = 'float',
|
|
||||||
})
|
|
||||||
|
|
||||||
function _lazygit_toggle()
|
function _lazygit_toggle()
|
||||||
|
if lazygit == nil then
|
||||||
|
lazygit = Terminal:new({
|
||||||
|
cmd = "lazygit",
|
||||||
|
hidden = true,
|
||||||
|
direction = 'float',
|
||||||
|
})
|
||||||
|
end
|
||||||
lazygit:toggle()
|
lazygit:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue