1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

Change side panel width calculation to work for larger numbers

This technically is a breaking change for some existing numbers,
but it stays the same for default case, and isn't much different for
others
This commit is contained in:
Chris McDonnell
2025-02-19 00:19:59 -05:00
committed by Jesse Duffield
parent e62aeb99ed
commit 9d0740427e
2 changed files with 88 additions and 7 deletions

View File

@@ -202,6 +202,86 @@ func TestGetWindowDimensions(t *testing.T) {
B: information
`,
},
{
name: "0.5 SidePanelWidth",
mutateArgs: func(args *WindowArrangementArgs) {
args.UserConfig.Gui.SidePanelWidth = 0.5
},
expected: `
╭status──────────────────────────────╮╭main───────────────────────────────╮
│ ││ │
╰────────────────────────────────────╯│ │
╭files───────────────────────────────╮│ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
╰────────────────────────────────────╯│ │
╭branches────────────────────────────╮│ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
╰────────────────────────────────────╯│ │
╭commits─────────────────────────────╮│ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
╰────────────────────────────────────╯│ │
╭stash───────────────────────────────╮│ │
│ ││ │
╰────────────────────────────────────╯╰───────────────────────────────────╯
<options──────────────────────────────────────────────────────>A<B────────>
A: statusSpacer1
B: information
`,
},
{
name: "0.8 SidePanelWidth",
mutateArgs: func(args *WindowArrangementArgs) {
args.UserConfig.Gui.SidePanelWidth = 0.8
},
expected: `
╭status────────────────────────────────────────────────────╮╭main─────────╮
│ ││ │
╰──────────────────────────────────────────────────────────╯│ │
╭files─────────────────────────────────────────────────────╮│ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
╰──────────────────────────────────────────────────────────╯│ │
╭branches──────────────────────────────────────────────────╮│ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
╰──────────────────────────────────────────────────────────╯│ │
╭commits───────────────────────────────────────────────────╮│ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
│ ││ │
╰──────────────────────────────────────────────────────────╯│ │
╭stash─────────────────────────────────────────────────────╮│ │
│ ││ │
╰──────────────────────────────────────────────────────────╯╰─────────────╯
<options──────────────────────────────────────────────────────>A<B────────>
A: statusSpacer1
B: information
`,
},
{
name: "half screen mode, enlargedSideViewLocation left",
mutateArgs: func(args *WindowArrangementArgs) {