Implemented new actions `FirstTab`, `LastTab`, `FirstSplit` and `LastSplit`
This PR changes the default behavior of NextTab, PreviousTab, NextSplit, PreviousSplit to not walk in circles anymore but instead splits those actions up into more atomic actions.
So e.g. NextTab just selects the next tab but doesn't switch to the first tab in case you run the action on the last tab. A new action FirstTab has been added and can be chained to restore the original behavior.
"PreviousTab" -> "PreviousTab|LastTab",
"NextTab" -> "NextTab|FirstTab",
"PreviousSplit" -> "PreviousSplit|LastSplit",
"NextSplit" -> "NextSplit|FirstSplit",
This adds a lot of flexibility to the user to create more sophisticated keybindings.
The following keybinding allows a combination of split and tab switching:
"Alt-,": "PreviousSplit|PreviousTab|LastTab",
"Alt-.": "NextSplit|NextTab|FirstTab",
I have just found another bug concerning the order of the split selection.
When adding a new BufPane it is always being inserted last into MainTab().Panes.
This leads to a confusion when using the actions PreviousSplit, NextSplit as the next/previous split may not be the expected one.
How to reproduce:
- Launch micro and insert char "1"
- Open a new vsplit via the command
vsplitand insert "2" - Switch back to the left split (1) by using
PreviousSplit - Again open a new vsplit via command:
vsplitand type char "3" - Now switch between the 3 splits using
PreviousSplit,NextSplit
Switching from most left split to the most right, the expected order would be 1, 3, 2 but actually is 1, 2, 3.
I did. :)
Thanks for your time and the reviews guys. :+1: