Conversation
- Implement synchronization of split layout with the current document state. - Handle split view requests including split, close pane, and focus navigation. - Draw editor panes based on split layout, supporting both horizontal and vertical splits. - Update menubar to include options for managing split views.
There was a problem hiding this comment.
Pull request overview
This PR introduces split editor views (horizontal and vertical panes), associated menu entries and shortcuts, and improves how keyboard shortcuts are rendered in the menubar (including platform-specific modifier glyphs).
Changes:
- Add split-view data structures (
SplitDirection,Pane,SplitLayout) and split-related state flags, plus unit tests forSplitLayout. - Extend the editor drawing pipeline to manage split panes (syncing layout, handling split/close/focus requests, and rendering horizontal/vertical layouts with pane headers).
- Update keyboard handling, menubar entries, shortcut rendering (including special keys and backslash), and modifier translations to support the new split-view actions and nicer shortcut labels.
Reviewed changes
Copilot reviewed 3 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
i18n/edit.toml |
Adds localized strings for new View menu items related to split views and pane focus/closing. |
crates/edit/src/input.rs |
Introduces vk::BACKSLASH virtual key constant to support Ctrl+\ and related shortcuts. |
crates/edit/src/tui.rs |
Enhances Context::menubar_shortcut to strip modifiers and render readable names for arrows, function keys, paging keys, and backslash; uses configured modifier translations. |
crates/edit/src/bin/edit/state.rs |
Defines SplitDirection, Pane, and SplitLayout, extends State with split-related fields, and adds unit tests covering default layout, pane counts, reset, and focus wrapping. |
crates/edit/src/bin/edit/main.rs |
Configures modifier translations with Mac-style symbols on Apple platforms and wires up global keyboard shortcuts for splitting, closing panes, and moving pane focus. |
crates/edit/src/bin/edit/draw_menubar.rs |
Adds View menu items for horizontal/vertical splits, closing the current pane, and focusing the next pane; ensures buffer borrow is dropped before accessing split_layout. |
crates/edit/src/bin/edit/draw_editor.rs |
Reworks editor drawing to synchronize and manage SplitLayout, process split/close/focus requests, and render single, horizontal, and vertical pane layouts, including pane headers and split-layout resets on document close. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for working on this. This looks really neat! As you probably noticed I'm backlogged on PRs. I'm working on other projects as well. And when it comes to Edit, I'm currently finishing my implementation for syntax highlighting which quite difficult and takes a lot of time. :( I hope to get to your PR(s) soon but will definitely look at them before we ship the next release (which will be a v2.0). |
Split the editor view into multiple panes, allowing users to: