From fd5820e14087fa34a287d12151056b0cf71783e4 Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Thu, 26 Oct 2023 00:33:32 +0300 Subject: [PATCH] Do not keep layout for NeogitCommitMessage --- plugin/buffers.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/buffers.lua b/plugin/buffers.lua index c52aaa8..246108e 100644 --- a/plugin/buffers.lua +++ b/plugin/buffers.lua @@ -14,12 +14,13 @@ local function close_buffer(command) end -- Never kill toggleterm - if vim.api.nvim_buf_get_option(buffer, 'filetype') == 'toggleterm' then + local filettype = vim.api.nvim_buf_get_option(buffer, 'filetype') + if filettype == 'toggleterm' then toggleterm.toggle(1) return end - if vim.api.nvim_buf_get_option(buffer, 'buftype'):len() ~= 0 or stickybuf.should_auto_pin(buffer) then + if vim.api.nvim_buf_get_option(buffer, 'buftype'):len() ~= 0 or stickybuf.should_auto_pin(buffer) or filettype == 'NeogitCommitMessage' then local winid = vim.fn.bufwinid(buffer) if stickybuf.is_pinned(winid) then stickybuf.unpin(winid)