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

feature: Merging the Swapping-Windows and Swap-Two-Windows features. #29

Closed
1 task done
tot0rokr opened this issue Dec 26, 2024 · 4 comments
Closed
1 task done
Labels
enhancement New feature or request

Comments

@tot0rokr
Copy link

tot0rokr commented Dec 26, 2024

Did you check the docs?

  • I have read all the docs

Is your feature request related to a problem? Please describe.

I don't see why there should be separate Swapping-Windows and Swap-Two-Windows features.

Describe the solution you would like

I would like the UI/UX to follow Swapping-Windows, and the actual change to happen with Swap-Two-Windows.

Describe alternatives you have considered

For example, I suggest that it would be better to have a function that buffers A Window, which you decide to swap, and swaps it with the buffer of the highlighted window.

In other words, it would be better if the buffers were crossed in the same way as Swapping-Windows, but the buffers were only swapped with the A window that you wanted to move to in the first place, rather than all the buffers of all the windows.

Additional context

No response

@tot0rokr tot0rokr added the enhancement New feature or request label Dec 26, 2024
@MisanthropicBit
Copy link
Owner

Thanks for submitting an issue 🙂

Apologies but I do not understand your issue. Could you draw some example ascii art or try to explain the issue in a different way with a concrete situation?

I don't see why there should be separate Swapping-Windows and Swap-Two-Windows features.

One use case would be if you need to swap a window across multiple tabs. If you couldn't swap two windows you would have to move the window across all tabs and then move the other window the other way assuming you had enabled the option for swapping windows across tabs. In any case, if you don't need the feature then don't use it unless it is preventing you from something?

@tot0rokr
Copy link
Author

I'm sorry if this makes you feel bad. I'm not saying it's wrong, it's just a suggestion.

I'm talking about the examples in the README.

In the case of Swapping windows,
In “A|B|C”, if you move A to C, the end result is “B|C|A”,
I think it should be “C|B|A”.

I was wondering why it exists as a separate function from Swap-two-windows.

For Swap-two-windows, are you saying that you can swap windows between tabs?
If so, doesn't it overlap functionality with Move-between-tabs?

@MisanthropicBit
Copy link
Owner

I'm sorry if this makes you feel bad. I'm not saying it's wrong, it's just a suggestion.

You misunderstand. I don't feel bad about your suggestion, on the contrary, I appreciate you making one 👍

In the case of Swapping windows,
In “A|B|C”, if you move A to C, the end result is “B|C|A”,
I think it should be “C|B|A”.

I'm not sure I agree that end result is very intuitive but this is just my opinion of how swapping (swap mode specifically) should work and it's pretty difficult to convey via github. See below for the step-by-step changes for the different modes. I'm just using modes to explain although there's also a public api.

I'm talking about the examples in the README.

Thanks for the example, I think I understand better now. To clarify, using your example, here is what should happen using the different features of the plugin and wanting to move/swap A over to C (otherwise this might be a bug).

  • move mode:
    1. Start move mode in window A (A|B|C).
    2. Move A to the right (B|A|C).
    3. Move A to the right (B|C|A).
  • swap mode:
    1. Start swap mode in window A (A|B|C).
    2. Swap A to the right (B|A|C).
    3. Swap A to the right (B|C|A).
  • Swapping two windows:
    1. Mark window A for swapping (A|B|C).
    2. Navigate to window C (A|B|C).
    3. Mark window C for swapping (C|B|A).

You cannot really tell the difference between move and swap mode in this example but the former inserts a window into the layout in a given direction (do =vim.fn.winlayout() to see the current window layout) while the former swaps position with itself and the window in a given direction.

For Swap-two-windows, are you saying that you can swap windows between tabs?

Yes. In the configuration section of the README, you can configure the at_edge behaviour of mode and swap mode. One behaviour is moving/swapping across tabs (all behaviours are listed below the lua config code).

If so, doesn't it overlap functionality with Move-between-tabs?

I don't think so since moving a window and swapping a window do different things as I explained above. Hopefully, everything makes sense. If not, please don't hesitate to respond 🙂

@tot0rokr
Copy link
Author

Thanks for explaining it well enough.
I'm actually in the middle of creating a similar project like this and find it interesting.
I will support you.

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

No branches or pull requests

2 participants