lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

`gui.mainPanelSplitMode: {vertical,horizontal}` split in the wrong direction

Open cgsheeh opened this issue 3 years ago • 3 comments

Describe the bug Setting gui.mainPanelSplitMode splits the view vertically when set to "horizontal" and horizontally when set to "vertical".

To Reproduce Steps to reproduce the behavior:

  1. Set gui.mainPanelSplitMode to 'horizontal' in your LazyGit config.
  2. Load LazyGit and split the main panel. For example write a change to a file and attempt to commit specific hunks from the file.
  3. The split will be vertical, ie creating two side-by-side panels.

Expected behavior The split should be created with two panels one above the other, ie vertically.

Version info: commit=16802a048e0425182f08cf0e9a2bc31480e9a55d, build date=2023-02-01T11:02:43Z, build source=binaryRelease, version=0.37.0, os=linux, arch=amd64, git version=2.31.1 git version 2.31.1

Additional context It seems this statement has the values of true and false swapped. I tested locally and changing the values does cause the screen to split in the correct direction, and running go run cmd/integration_test/main.go cli seems happy. I can submit as a PR if this is in fact a bug.

cgsheeh avatar Feb 14 '23 04:02 cgsheeh

The split should be created with two panels one above the other, ie vertically.

Isn't that just due to how you look at it? The split itself is horizontal?

mark2185 avatar Feb 14 '23 05:02 mark2185

It's true that normally when people are talking about splitting views, they talk about the orientation of the line between the views. So "horizontal" means that the splitter line between the views is horizontal, meaning the views are stacked vertically on top of each other. And vice versa.

Some examples:

I haven't found any examples where people use lazygit's way of looking at it, which is to describe the orientation of the row or column in which the views are laid out. But then I didn't spend a ton of time on the search.

Personally it doesn't bother me too much, and it has the backwards compatibility problem ("fixing" the bug will change behavior for existing users), so I'm not sure it's worth changing it.

stefanhaller avatar Feb 14 '23 08:02 stefanhaller

The split should be created with two panels one above the other, ie vertically.

Isn't that just due to how you look at it? The split itself is horizontal?

It's possible this is the expected behaviour and the panes themselves are meant to be "horizontal". Other programs like Vim use the opposite terminology, referring to the direction of the line that splits the pane. For example the :vsplit command in Vim creates two side-by-side windows. The name of the function I linked in the issue description is splitMainPanelSideBySide, which I would imagine should be "vertical".

Personally it doesn't bother me too much, and it has the backwards compatibility problem ("fixing" the bug will change behavior for existing users), so I'm not sure it's worth changing it.

I understand there are BC concerns so if it makes more sense to leave it as-is I wouldn't be too upset either way. I'll add that it wasn't a great UX for me as I thought my config wasn't being honoured at first, and I had to explicitly try setting the wrong flag to see if it made the screen split in the opposite direction.

By the way, LazyGit is awesome, thanks for all your hard work on it.

cgsheeh avatar Feb 14 '23 15:02 cgsheeh