Better integration of window manipulation commands #1130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commands like
evil-window-rotate-upwards
andevil-window-move-very-top
onlyconsider the buffer in each window when manipulating the window tree, but if a
window has specific window properties that need to be maintained (like those in
window-persistent-parameters
) that information is lost.Refactor the window manipulation commands to use
window-state-get
andwindow-state-put
to retrieved and restore the state of the window tree sothat window properties in each window are maintained.
Also integrate the window manipulation commands with side windows, i.e. windows
with a non-nil
window-side
window parameter, by only manipulating the part ofthe window tree that are not side windows.
Add the macro
evil-save-side-windows
which removes all side windows onentering the macro environment and restores the side windows leaving.
Add the function
evil-move-window
which does the work ofevil-window-move-far-left
,evil-window-move-very-top
,evil-window-move-far-right
, andevil-window-move-very-bottom
. Thesefunctions were all identical, the only difference being which window was used
to restore the
selected-window
.Use
window-state-(get|put)
to get the window tree and to restore it. Thismakes
evil-get-buffer-tree
andevil-restore-window-tree
unnecessary andthey are removed. Note that
window-state-(get|put)
also handles windowparameters.
In addition to ignoring side windows when moving a window, ignore them in
evil-window-rotate-downwards
andevil-window-rotate-upwards
.