feat: make nvim Neovide compatible

This commit is contained in:
Fabio Lenherr / DashieTM 2023-04-09 00:49:51 +02:00
parent f3186bce02
commit f8661477fc
21 changed files with 4837 additions and 75 deletions

View file

@ -10,7 +10,6 @@
-- vim.cmd("set norelativenumber")
-- end,
-- })
-- nvim-tree is also there in modified buffers so this function filter it out
local modifiedBufs = function(bufs)
local t = 0
@ -25,16 +24,17 @@ end
vim.api.nvim_create_autocmd("BufEnter", {
nested = true,
callback = function()
if #vim.api.nvim_list_wins() == 1 and
vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil and
modifiedBufs(vim.fn.getbufinfo({ bufmodified = 1 })) == 0 then
vim.cmd "quit"
if
#vim.api.nvim_list_wins() == 1
and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil
and modifiedBufs(vim.fn.getbufinfo({ bufmodified = 1 })) == 0
then
vim.cmd("quit")
end
end
end,
})
local function open_nvim_tree(data)
-- buffer is a directory
local directory = vim.fn.isdirectory(data.file) == 1