Skip to content

Commit

Permalink
refactor(winbar): move to internal & disable in toggleterm
Browse files Browse the repository at this point in the history
  • Loading branch information
ecosse3 committed Aug 8, 2022
1 parent 8aba17a commit b7a9ab3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lua/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -50,7 +50,6 @@ if vim.fn.has('nvim-0.8') == 1 then
"lir",
"Outline",
"spectre_panel",
"toggleterm",
"TelescopePrompt",
"DressingInput",
"DressingSelect",
Expand All @@ -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
Expand All @@ -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
Expand Down
File renamed without changes.

0 comments on commit b7a9ab3

Please sign in to comment.