Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/codediff/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ M.defaults = {
-- Explorer panel configuration
explorer = {
position = "left", -- "left" or "bottom"
hidden = false,
width = 40, -- Width when position is "left" (columns)
height = 15, -- Height when position is "bottom" (lines)
view_mode = "list", -- "list" (flat file list) or "tree" (directory tree)
Expand Down
2 changes: 1 addition & 1 deletion lua/codediff/ui/explorer/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function M.create(status_result, git_root, tabpage, width, base_revision, target
current_file_path = nil, -- Track currently selected file
current_file_group = nil, -- Track currently selected file's group (staged/unstaged)
current_selection = nil, -- Full file selection used to replay current state
is_hidden = false, -- Track visibility state
is_hidden = explorer_config.hidden, -- Track visibility state
visible_groups = vim.deepcopy(explorer_config.visible_groups or { staged = true, unstaged = true, conflicts = true }),
}

Expand Down
4 changes: 4 additions & 0 deletions lua/codediff/ui/view/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ function M.setup_explorer(tabpage, session_config, original_win, modified_win)
local explorer_obj =
explorer_module.create(status_result, session_config.git_root, tabpage, nil, session_config.original_revision, session_config.modified_revision, explorer_opts)

if explorer_config.hidden == true then
vim.api.nvim_win_close(explorer_obj.winid, true)
end

lifecycle.set_explorer(tabpage, explorer_obj)

local initial_focus = explorer_config.initial_focus or "explorer"
Expand Down