From b7a9ab3ea6eadbf23eecbbdbbb37e4913573875f Mon Sep 17 00:00:00 2001 From: ecosse3 Date: Mon, 8 Aug 2022 16:26:09 +0200 Subject: [PATCH] refactor(winbar): move to internal & disable in toggleterm --- lua/autocmds.lua | 11 +++++++---- lua/{ => internal}/winbar.lua | 0 2 files changed, 7 insertions(+), 4 deletions(-) rename lua/{ => internal}/winbar.lua (100%) diff --git a/lua/autocmds.lua b/lua/autocmds.lua index c4136668..7891ebe0 100644 --- a/lua/autocmds.lua +++ b/lua/autocmds.lua @@ -11,7 +11,7 @@ vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { pattern = { "*.txt", command = "setlocal spell" }) -- Attach specific keybindings in which-key for specific filetypes -local present, wk = pcall(require, "which-key") +local present, _ = pcall(require, "which-key") if not present then return end local _, pwk = pcall(require, "plugins.which-key") @@ -50,7 +50,6 @@ if vim.fn.has('nvim-0.8') == 1 then "lir", "Outline", "spectre_panel", - "toggleterm", "TelescopePrompt", "DressingInput", "DressingSelect", @@ -61,6 +60,10 @@ if vim.fn.has('nvim-0.8') == 1 then return end + if vim.bo.filetype == 'toggleterm' then + return + end + if vim.tbl_contains(winbar_filetype_exclude, vim.bo.filetype) then vim.opt_local.winbar = nil return @@ -72,8 +75,8 @@ if vim.fn.has('nvim-0.8') == 1 then return end - local present, winbar = pcall(require, "winbar") - if not present or type(winbar) == "boolean" then + local winbar_present, winbar = pcall(require, "internal.winbar") + if not winbar_present or type(winbar) == "boolean" then vim.opt_local.winbar = nil return end diff --git a/lua/winbar.lua b/lua/internal/winbar.lua similarity index 100% rename from lua/winbar.lua rename to lua/internal/winbar.lua