vim: Add keybindings for resizing docks (#23874)

Closes #23334

This does not follow the exact way that windows are resized in vim.
Normally the command is `ctrl-w >` however this PR uses just `ctrl->`.
This is because I could not find a good way to read in a count like `10
ctrl-w ctrl->`. This is not really a problem since `ctrl->` can be held
down, which, in my opinion, speeds up resizing. I think this is a good
compromise since it improves usability; however, I am concerned that
this is not intuitive. I am looking forward to feedback.

Release Notes:

- Added the following commands 
  - vim::ResizeLeftDock
  - vim::ResizeRightDock
  - vim::ResizeBottomDock
- Added keybinds
  - `ctrl->` for widening left dock
  - `ctrl-<` for narrowing left dock
This commit is contained in:
AidanV 2025-01-31 20:50:16 -08:00 committed by GitHub
parent a3c7dc3321
commit d0152f9eb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 6 deletions

View file

@ -124,7 +124,7 @@ pub fn init(cx: &mut App) {
workspace.reset_pane_sizes(cx);
});
workspace.register_action(|workspace, _: &MaximizePane, _, cx| {
workspace.register_action(|workspace, _: &MaximizePane, window, cx| {
let pane = workspace.active_pane();
let Some(size) = workspace.bounding_box_for_pane(&pane) else {
return;
@ -138,7 +138,7 @@ pub fn init(cx: &mut App) {
} else {
px(10000.)
};
workspace.resize_pane(Axis::Vertical, desired_size - size.size.height, cx)
workspace.resize_pane(Axis::Vertical, desired_size - size.size.height, window, cx)
});
workspace.register_action(|workspace, action: &ResizePane, window, cx| {
@ -162,7 +162,7 @@ pub fn init(cx: &mut App) {
ResizeIntent::Narrow => (Axis::Horizontal, width.width * -1.),
};
workspace.resize_pane(axis, amount * count, cx);
workspace.resize_pane(axis, amount * count, window, cx);
});
workspace.register_action(|workspace, _: &SearchSubmit, window, cx| {