fix: do not auto resize in full view (#2661)

This commit is contained in:
yetone
2025-08-31 22:09:18 +08:00
committed by GitHub
parent bcbe0347d8
commit e63427fb9a
2 changed files with 3 additions and 0 deletions

View File

@@ -246,6 +246,7 @@ function H.autocmds()
local sidebar = M.get()
if not sidebar then return end
if not sidebar:is_open() then return end
if sidebar.is_in_full_view then return end
sidebar:resize()
end,
})

View File

@@ -1514,6 +1514,7 @@ function Sidebar:toggle_code_window()
local container_winids = vim.tbl_map(function(container) return container.winid end, self.containers)
local win_width = api.nvim_win_get_width(self.code.winid)
if win_width == 0 then
self.is_in_full_view = false
for _, winid in ipairs(winids) do
if not vim.tbl_contains(container_winids, winid) and api.nvim_win_is_valid(winid) then
local old_width = self.win_width_store[winid]
@@ -1521,6 +1522,7 @@ function Sidebar:toggle_code_window()
end
end
else
self.is_in_full_view = true
for _, winid in ipairs(winids) do
if not vim.tbl_contains(container_winids, winid) and api.nvim_win_is_valid(winid) then
if Utils.is_floating_window(winid) then