-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Workspace move editor actions #21760
base: main
Are you sure you want to change the base?
Workspace move editor actions #21760
Conversation
Marked as ready for review based on this comment: #20205 (comment) |
|
One counterpoint I can think of, is if you start by creating all the splits the way you like and then proceed to move items around, you may close a pane when you didn't meant to. But otherwise there is no merit to keep it, it looks wrong and there is no way to close it through UI at the moment.
I tried moving an editor to the terminal pane with the mouse and it didn't work (I mean it pasted the file path as, I assume, intended). Now after your comment I realize that moving terminals within the terminal pane should be possible in the same fashion, right... I'll look into it and add it tomorrow. Have you thought about a more unified model to pane splitting and navigation for editors and termianls? |
That reason is good, but seems rather small compared to the inactionable panels?
I have thought about it, and decided that's hard to do given the fact that terminal panel restricts other kinds of items, and differently reacts to files being dropped inside it. zed/crates/terminal_view/src/terminal_panel.rs Lines 1122 to 1135 in 26ba48e
This PR does pretty much the same, but not in a unified way, so I can return the question back. |
Fair enough. Foolish consistency, yada yada... I'll add similar calls to the terminal crate, and adjust the original if needed. Found a bug in 2024-12-10_14-56-11.mp4Error log from the linux machine
Also, question from the issue thread about keybinding: "ctrl-shift-1": ["workspace::MoveItemToPane", 0],
"ctrl-shift-2": ["workspace::MoveItemToPane", 1],
"ctrl-shift-3": ["workspace::MoveItemToPane", 2],
"ctrl-shift-4": ["workspace::MoveItemToPane", 3],
"ctrl-shift-5": ["workspace::MoveItemToPane", 4],
"ctrl-shift-6": ["workspace::MoveItemToPane", 5],
"ctrl-shift-7": ["workspace::MoveItemToPane", 6],
"ctrl-shift-8": ["workspace::MoveItemToPane", 7],
"ctrl-shift-9": ["workspace::MoveItemToPane", 8]
|
For that, it's better to do incremental, potentially smaller updates instead of changing the entire mechanism at once. Later, after allowing to split/move things however we like, one can go and land an approach on top, dealing with all actions that may leave the pane empty — deciding what to do in this case seems like a good task on its own. So the only foolish thing I see here is the appearance of this word in the discussion and, overall, hastiness to slap labels on things.
|
a58bf75
to
0c2340f
Compare
f8d3f2c
to
a9252ae
Compare
Implemented the actions for the terminal panel and cleaned things up a bit. I think, in it's current state, it can pass as an "incremental, potentially smaller update". Intentionally missing:
And, question about hotkeys, @ConradIrwin, please, give us your judgement about #20205 (comment) and, maybe look at the #14817 as well? I'd like to see that implemented, maybe after this PR, I'll try making that happen next. Thanks! |
a9252ae
to
6ed4888
Compare
@Igonato for vim we should use In the current state of things, closing the empty pane is consistent with how Zed does things (and with vim :D), so for getting this shipped, we should close them. If we come back to #14187, I think the two questions to answer are:
|
That's how it's implemeneted right now.
This had me confused for a minute :D
If one to get an inspiration from zellij layouts, then something similar to |
Can any mac user install Sublime and post contents of the |
Sublime keymap
|
Analogous to the Sublime's ctrl+shif+*number* shortcut
Closes zed-industries#20205 An action to move the active editor to a pane in a specified direction
6ed4888
to
63a60f9
Compare
Noticed something, when switching ( 2024-12-11_19-42-07.mp4 |
Question: I'd like to add an option to keep the focus in the source pane (as suggested in #14817). What is the best way to add it? Is there an action that has default params I can look at? Would it be better to add as set of separate cations On a related note: what do you think about a set of unparameterized actions that will appear in the command palette for discoverability ( |
Not sure about the lag, one idea might be that a moved element is not redrawing timely (
I think that adding another parameter makes more sense than a setting or separate actions, as people can bind it however they like this way. zed/crates/editor/src/actions.rs Lines 18 to 23 in 937186d
zed/assets/keymaps/default-macos.json Lines 116 to 117 in 937186d
is one example of such definitions. |
Closes #20205
Release Notes:
MoveItemToPane
andMoveItemToPaneInDirection
actions