-
Notifications
You must be signed in to change notification settings - Fork 621
Add support split views #750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add support split views #750
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Split the editor view into multiple panes, allowing users to: