Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for secondary direction layout split #231

Open
akiross opened this issue Mar 27, 2024 · 2 comments
Open

Add support for secondary direction layout split #231

akiross opened this issue Mar 27, 2024 · 2 comments

Comments

@akiross
Copy link

akiross commented Mar 27, 2024

Hello,
I've been very happy to know that someone is going on with the development of diffuse! I've been using the "sourceforge" version for years and found out about this fork only recently.

Now, back to my issue: I was wondering if it would be possible add an "secondary direction split" option, meaning that instead of A|B|C|D:

+----------+----------+----------+----------+
|    A     |    B     |    C     |    D     |
+----------+----------+----------+----------+

things could look like this (A|C|D)/B

+----------+----------+----------+
|    A     |    C     |    D     |
+----------+----------+----------+
|               B                |
+--------------------------------+

or like this B/(A|C|D)

+--------------------------------+
|               B                |
+----------+----------+----------+
|    A     |    C     |    D     |
+----------+----------+----------+

which can be convenient when doing merges with 4 files (old, parent, merged, new).

I am not sure how the UX of this could be, some ideas:

  1. have a flag to specify whether to enable this, and by default one specific panel (e.g. the first, the last) will be moved down or up
  2. have a flag to specify when to enable this: if the number of files is 4, move the X panel down or up
  3. use floating windows: each file is a panel that can be arranged arbitrarily; this might allow for fancy layouts like A / (B | C) / D and it's the most flexible one
  4. allow to specify a layout string, such as A|B|C|D, (A|B)/(C|D), A|(B|C|D) and split the screen according to that; fail if the number of files is not matching the string (I like this option best).

What do you think?

@joyously
Copy link

What is supposed to happen with the wider file? Is it part of the diff? Does it still scroll with the others? What's the goal?

Aside: the Windows editor Textpad does a split (for multiple views of one file) at any time by dragging a handle at the top of the scrollbar. I think it has a setting for whether the parts scroll together or not. It also has subwindow controls for each file so if you click fullscreen on any of them, they all fill the editor window (and you can switch between from other navigation), or toggle fullscreen off and they all are small windows in the editor window which can be arranged however you prefer.

@akiross
Copy link
Author

akiross commented Mar 29, 2024

Yes, the wider file is part of the diff and I think it should scroll with the others.

The goal is to provide a more intuitive understanding of the role of the files given their spatial position. To be honest, I don't think there might be many for regular code merging. For example, it follows the intuition to have 3 horizontal splits in which the left and the right sides get merged in the central one. What happens if a "common base" file is added? Spatially, it makes sense to have the "common base" on the top, or the "merged one" on the bottom.

This is somewhat similar to what vimdiff does when it is used as a merge tool for git: https://git-scm.com/docs/vimdiff/en

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants