fixed dynamic tab inconsistencies, undotree keybind

This commit is contained in:
2023-02-13 05:22:55 -06:00
parent da374365c8
commit 849fc17535
5 changed files with 35 additions and 38 deletions
+3 -11
View File
@@ -1,24 +1,16 @@
local M = {}
-- Whether to switch between buffers or tabs
local function tab_mode()
function M.tab_mode()
return vim.fn.tabpagenr("$") > 1
end
-- Whether to show windows or buffers in lualine
local function window_mode()
return vim.fn.winnr("$") > 1 or tab_mode()
end
M.tab_mode = tab_mode
M.window_mode = window_mode
function M.tab()
vim.cmd(tab_mode() and "tabn" or "bnext")
vim.cmd(M.tab_mode() and "tabn" or "bnext")
end
function M.shift_tab()
vim.cmd(tab_mode() and "tabp" or "bprevious")
vim.cmd(M.tab_mode() and "tabp" or "bprevious")
end
return M