Skip to content
Draft
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
4 changes: 2 additions & 2 deletions lua/codediff/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ M.defaults = {

-- Explorer panel configuration
explorer = {
position = "left", -- "left" or "bottom"
position = "left", -- "left", "right", or "bottom"
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 All @@ -72,7 +72,7 @@ M.defaults = {

-- History panel configuration (for :CodeDiff history)
history = {
position = "bottom", -- "left" or "bottom" (default: bottom)
position = "bottom", -- "left", "right", or "bottom" (default: bottom)
width = 40, -- Width when position is "left" (columns)
height = 15, -- Height when position is "bottom" (lines)
initial_focus = "history", -- Initial focus: "history", "original", or "modified"
Expand Down
6 changes: 3 additions & 3 deletions lua/codediff/ui/layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function M.arrange(tabpage)

-- Step 1: Pin panel size (fixed element)
if panel_visible then
if panel_position == "left" then
if panel_position == "left" or panel_position == "right" then
vim.api.nvim_win_set_width(panel_win, panel_config.width)
else
vim.api.nvim_win_set_height(panel_win, panel_config.height)
Expand All @@ -51,7 +51,7 @@ function M.arrange(tabpage)
local sole_win = orig_valid and original_win or (mod_valid and modified_win or nil)
if sole_win then
if panel_visible then
if panel_position == "left" then
if panel_position == "left" or panel_position == "right" then
vim.api.nvim_win_set_width(panel_win, panel_config.width)
-- Explicitly set diff window to fill remainder
local remainder = vim.o.columns - panel_config.width - 1
Expand Down Expand Up @@ -117,7 +117,7 @@ function M.arrange(tabpage)

-- Step 5: Re-pin panel size (undo disturbance from step 4)
if panel_visible then
if panel_position == "left" then
if panel_position == "left" or panel_position == "right" then
vim.api.nvim_win_set_width(panel_win, panel_config.width)
else
vim.api.nvim_win_set_height(panel_win, panel_config.height)
Expand Down