Fix lazygit vim fugitive conflict
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
if g:lazygit_use_neovim_remote && executable("nvr")
|
if g:lazygit_opened && g:lazygit_use_neovim_remote && executable("nvr")
|
||||||
augroup lazygit_neovim_remote
|
augroup lazygit_neovim_remote
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd WinLeave <buffer> :LazyGit
|
autocmd WinLeave <buffer> :LazyGit
|
||||||
|
autocmd WinLeave <buffer> :setglobal lazygit_opened=0
|
||||||
augroup END
|
augroup END
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ local fn = vim.fn
|
|||||||
|
|
||||||
LAZYGIT_BUFFER = nil
|
LAZYGIT_BUFFER = nil
|
||||||
LAZYGIT_LOADED = false
|
LAZYGIT_LOADED = false
|
||||||
|
vim.g.lazygit_opened = 0
|
||||||
|
|
||||||
--- Strip leading and lagging whitespace
|
--- Strip leading and lagging whitespace
|
||||||
local function trim(str)
|
local function trim(str)
|
||||||
@@ -42,6 +43,7 @@ local function on_exit(job_id, code, event)
|
|||||||
vim.cmd("silent! :q")
|
vim.cmd("silent! :q")
|
||||||
LAZYGIT_BUFFER = nil
|
LAZYGIT_BUFFER = nil
|
||||||
LAZYGIT_LOADED = false
|
LAZYGIT_LOADED = false
|
||||||
|
vim.g.lazygit_opened = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -49,6 +51,7 @@ end
|
|||||||
local function exec_lazygit_command(cmd)
|
local function exec_lazygit_command(cmd)
|
||||||
if LAZYGIT_LOADED == false then
|
if LAZYGIT_LOADED == false then
|
||||||
-- ensure that the buffer is closed on exit
|
-- ensure that the buffer is closed on exit
|
||||||
|
vim.g.lazygit_opened = 1
|
||||||
vim.fn.termopen(cmd, { on_exit = on_exit })
|
vim.fn.termopen(cmd, { on_exit = on_exit })
|
||||||
end
|
end
|
||||||
vim.cmd "startinsert"
|
vim.cmd "startinsert"
|
||||||
|
|||||||
Reference in New Issue
Block a user