feat(window): add vim-style directional window moves#155
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
The existing
Ctrl-w h/j/k/lbindings only change focus, so there is no Vim-compatible way to physically reposition the active split. Recreating a window to simulate movement would also lose stable window identity, viewport state, attached window bars, and unrelated split ratios.What Changed
Ctrl-w H/J/K/Lto move the active split to the full-height left/right or full-width top/bottom edge while keeping lowercase focus navigation unchanged.How to Test
Ctrl-w v, then a horizontal split withCtrl-w s; open a different file in each pane.Ctrl-w H,Ctrl-w J,Ctrl-w K, andCtrl-w L. Verify the active file moves to the full left, bottom, top, and right edge, remains focused, and retains its cursor.Ctrl-e, repeat a window move, and verify the sidebar remains visible and the editor panes stay inside the reserved area.Ctrl-w h/j/k/lstill only changes focus. Repeat a move toward an already occupied outer edge and confirm it is a silent no-op.cargo test --lib windowandcargo test --test editing --quietto exercise stable IDs, plugins, recovery, real shifted key events, legacy keymaps, and side panels.Validation
cargo test --all-features --quiet— 1,588 passing tests.cargo clippy --all-targets --all-features -- -D warnings.cargo fmt --all -- --check.