diff options
author | Roland Kovacs | 2022-05-20 01:25:04 +0000 |
---|---|---|
committer | GitHub | 2022-05-20 01:25:04 +0000 |
commit | 8958bf0a926a6e6afc63f0c59f3fa6761f5da709 (patch) | |
tree | b48042f1f03cefb99bdf14d970ff937a60bc211e /helix-term/src/commands.rs | |
parent | 62fd1f699988bdf7bba4a9ada511b5303b01d328 (diff) |
Implement view transpose (#2461)
Change the layout of existing split view from horizontal to vertical and
vica-versa. It only effects the focused view and its siblings, i.e. not
recursive.
Command is mapped to 't' or 'C-t' under the Window menus.
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index f0b54e0b..855f2d7d 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -360,6 +360,7 @@ impl MappableCommand { jump_view_left, "Jump to the split to the left", jump_view_up, "Jump to the split above", jump_view_down, "Jump to the split below", + transpose_view, "Transpose splits", rotate_view, "Goto next window", hsplit, "Horizontal bottom split", hsplit_new, "Horizontal bottom split scratch buffer", @@ -3863,6 +3864,10 @@ fn jump_view_down(cx: &mut Context) { cx.editor.focus_down() } +fn transpose_view(cx: &mut Context) { + cx.editor.transpose_view() +} + // split helper, clear it later fn split(cx: &mut Context, action: Action) { let (view, doc) = current!(cx.editor); |