repl: Change default run actions to run line and add four run related actions#46868
repl: Change default run actions to run line and add four run related actions#46868gepcel wants to merge 8 commits intozed-industries:mainfrom
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @gepcel on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@rgbkrk Would you mind take a look at this, and see if it's appropriate. I've built and tested locally. |
|
At the very least, I like the change in naming if someone is "in" a cell, on a line, or selecting contents. I don't want to overload the menu with too many options though so I prefer to make it more context dependent. Now... actions wise it probably makes sense to have multiple, just not all shown in one menu. |
|
I'm not sure I followed. By saying "the menu", you mean the And I'd like your opinion on another thing. If cursor on line 2 of the following example, when execute the [1] import numpy as np
[2] a = 3
[3]
[4] # %%
[5] print(a) # cursor here |
|
Close this due to not clear what to do next. |
I'm talking the visual repl menu.
I'd prefer (2) as well. |
|
About the "repl menu" menu, previously there's only one item about run action, in this pr, I did nothing to it, so there is now still only one item.
Do you want add something to the menu? Or do you want to reduce anything from the menu?
This I can do. |
|
Based on the feedback from @rgbkrk, the following changes have been made. The command palette now displays two original actions and four newly added actions:
The names of these actions are self-explanatory, but a few details are worth noting:
|
|
I've made some changes and would like your decision on a few points, @rgbkrk or someone else interested. Let me use the following code examples with line numbers: Example 1 [1] print(1)
[2] print(2)
[3] print(3)Example 2, different file from example 1, assume line starts from 4 for discuss. [4] print(4)
[5] print(5)
[6] print(6)
[7] # %% first cell mark
[8] print(7)
[9] print(8)
[10] # %%
[11] print(9)Now, regarding the behavior of two commands:
|
exclusive.. Signed-off-by: gepcel <gepcelway@gmail.com>
b06847e to
65814f1
Compare
|
@rgbkrk Now this is ready for review, please have a look. |
- This also sends the cursor to block placement anchor which is the standard thing to happen when we run cmd/ctrl + shift + enter, this is usually used for Run and Move onto next cell. - Perhaps the ability to stay on the same code will be tackled on further works where not using the shift modifier would signify stay and "just" run the cell. Like #46868 Closes #48069 Release Notes: - Fixed cursor becoming invisible on the last line of REPL cells after re-running
…industries#48218) - This also sends the cursor to block placement anchor which is the standard thing to happen when we run cmd/ctrl + shift + enter, this is usually used for Run and Move onto next cell. - Perhaps the ability to stay on the same code will be tackled on further works where not using the shift modifier would signify stay and "just" run the cell. Like zed-industries#46868 Closes zed-industries#48069 Release Notes: - Fixed cursor becoming invisible on the last line of REPL cells after re-running
I've looked back at your comment, I realize I still haven’t fully understood your point — my initial interpretation may have been wrong, possibly due to my limited English. Could you explain it in more detail? Just tell me directly what I should do, or what effect I should aim for. If I’m able to implement it, I’ll follow your instructions accordingly. Waiting for weeks or even over a month, left me wondering if you’re expecting me to do something, or if you just don’t like this PR at all. I'm fine if you drop this, because I’m really not trying to push it. |
|
I'm sorry. I feel bad having you delay. I wasn't fully understanding either and I kept meaning to come back to your PR. I'll try to prioritize another look at it. |
|
It might not have been clearly communicated due to the English expression—the modification is actually not complicated at all, and the logic will become clear upon simple trial. I have now completed all the work I planned for. It is now up to you or someone else from the dev team to decide whether this is feasible and what else needs to be done. There are also some suggestions from others you may want to check. Once decided, please directly specify what needs to be done, to avoid misunderstandings. I was a liile bit hard to get your point, and you might feel the same vice versa. |
|
Thank you for the contribution. I'll get this folded in somehow with the other ongoing changes to this and give you commit attribution. |
edited in 2026-02-02:
Should be able to close #46594, #19031, #16961
This pr changes the default behavior of two already existed actions:
RunandRun in placeto run lines. And add four other actions:Run cellandRun cell in palceto run cells,Run aboveto run cells above,Run allto run all cells.Previous this pr there were two actions in repl: Run (included in repl menu, as shown in the following pic) and RunInPlace (not included in repl menu). When there are no cells (as of no
# %%mark in python script file), these actions run current line or selected lines. When there are cells in file, these actions run current cell or selected cells, therefore no way to execute line inside a cell.Release Notes:
RunCell,RunCellInPlace,RunAboveandRunAll.