From f3398f8639e903991acdf66e2d63de7a78fe708e Mon Sep 17 00:00:00 2001 From: emmanueltouzery Date: Tue, 24 Oct 2023 04:50:35 +0200 Subject: [PATCH] fix: disable for Neogit commit message (#23) --- lua/stickybuf.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/stickybuf.lua b/lua/stickybuf.lua index 1a086a3..31b29aa 100644 --- a/lua/stickybuf.lua +++ b/lua/stickybuf.lua @@ -285,7 +285,12 @@ M.should_auto_pin = function(bufnr) elseif filetype == "fern" and (vim.wo.winfixwidth or vim.wo.winfixheight) then -- Only pin fern if it was opened as a split (has fixed height/width) return "filetype" - elseif vim.startswith(filetype, "Neogit") then + elseif + vim.startswith(filetype, "Neogit") + -- NeogitCommitMessage relies on BufUnload, can't apply to it + -- https://github.com/NeogitOrg/neogit/blob/51a6e6c8952b361300be57b36c8e1b973880cdd7/lua/neogit/buffers/commit_editor/init.lua#L43 + and filetype ~= "NeogitCommitMessage" + then if vim.fn.winnr("$") > 1 then return "filetype" end