zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
46.92k stars 2.69k forks source link

repl: allow executing multiple lines through multi-cursor #15134

Open pantheraleo-7 opened 1 month ago

pantheraleo-7 commented 1 month ago

Check for existing issues

Describe the feature

Currently we can run multiple lines through jupytext code blocks or selection, but both require a few steps. The former requires structuring the py script as kind of a notebook with # %% and the latter requires precise selection of all the characters of the lines one wants to run and missing any will probably result in SyntaxError.

This proposed feature will be the fastest way to run multiple lines at once IMO.

If applicable, add mockups / screenshots to help present your vision of the feature

Current behaviour: https://github.com/user-attachments/assets/1962b1c1-5d7e-4e3a-905f-1b3fc3dee504

Proposed behaviour: hello world

pantheraleo-7 commented 1 month ago

One thing I noticed but don't know if it's a good idea to open an issue for that, so mentioning here:

Running selections is not allowed (or supported?) in jupytext mode. If it's done intentionally to maintain the sanctity of py:percent files than all is good

@rgbkrk

rgbkrk commented 1 month ago

Running selections is not allowed (or supported?) in jupytext mode. If it's done intentionally to maintain the sanctity of py:percent files than all is good

Yeah that's why. You can however select across multiple jupytext cells and each will run individually.

pantheraleo-7 commented 1 month ago

You can however select across multiple jupytext cells and each will run individually.

wow just tried, great stuff