[Feature Request] Multi-Cursor Support
Currently, the Pharo code editor lacks multi-cursor support, a feature available in most modern editors such as VSCode. This limitation makes it cumbersome to perform bulk edits, such as renaming multiple occurrences of a variable, inserting text at multiple locations, or modifying code structure across lines.
The goal is to implement multi-cursor editing in the Pharo code editor, allowing users to edit multiple locations simultaneously. Ideally, the implementation should match the functionality of VSCode, with the following features:
- Adding and Managing Cursors
- Manually place multiple cursors (e.g.,
Cmd+Clickto insert additional cursors). - Select next occurrence of a word (
Cmd+D) to quickly add a cursor at the next instance of the selected text. - Select all occurrences (
Cmd+Shift+L) to apply changes to every instance in the current scope. - Remove the last added cursor (
Cmd+U) to revert accidental selections.
- Editing with Multiple Cursors
- Type, delete, copy, and paste at all cursors simultaneously.
- Navigate and move all cursors together.
- Undo/redo all actions as a group while preserving multi-cursor state.
- Multi-line insertion (e.g.,
Cmd+Alt+Arrow Up/Downto insert a new cursor on the next line).
- [Optional] Column Selection Mode (Block Selection)
- Create a vertical selection of text (e.g.,
Alt+DragorCmd+Shift+Alt+Arrow).
Expected development cost
Implementing multi-cursor editing will require:
- Enhancements to the text editor's input handling.
- UI feedback for multiple cursors (e.g., blinking cursors, selection highlighting).
- Adjustments to the editing model to support simultaneous changes.
- Handling of undo/redo operations in multi-cursor mode.
Additional context
Here are references to how other editors handle multi-cursor support:
Brick has some multi-cursor support. Using Command-click to add cursors would conflict with existing functionality. See: GToolkit issue #3937.
Note: this issue is linked to a GSoC 2025 proposal, so let's try to keep it active for now (i.e., do not close it).
I didn't know about Brick, it would be interesting to see how it's done as a reference for Rubric (the current editor for Pharo).
The shortcuts from the OP are directly from VSCode to let readers try them out easily, they are not indicative of the shortcuts that would be used in Pharo.
Interest in Contributing to Multi-Cursor Support in Pharo Editor
Hi Gabriel,
I came across the discussion on implementing multi-cursor support in the Pharo code editor, and I’m really interested in contributing to this feature. Since modern editors like VSCode provide this functionality, adding it to Pharo would greatly enhance the editing experience.
Before I begin, I wanted to check if:
Is anyone actively working on this feature, or is it open for contribution?
Would it be best to start with cursor management (Cmd+Click, Cmd+D, etc.) before implementing full multi-cursor editing?
Are there any guidelines, existing discussions, or relevant classes I should focus on to ensure my approach aligns with Pharo’s architecture?
I’d love to collaborate with the team and make incremental contributions. Let me know if this is something I can start working on, and if you have any suggestions on how to proceed.
Looking forward to your thoughts!
Best regards, Yeruva Shanmukha Manohara Reddy
Hi @manoharreddyshanmukha, thanks for your interest :) This is open for contributions. Since this is not a trivial issue, it will not be done with a single PR, so everyone should feel free to propose something, even if it only covers a small part.
For now, this is still in the early stages, so we need an understanding of the existing system and a plan:
- Take a look at Rubric, the current code editor, and how/where cursors are implemented.
- Album, a WIP editor forked from Brick discussed above, has some multi-cursor support, how is it implemented?
- Which keyboard shortcuts should we use in Pharo? The shortcuts provided in the OP are from VSCode, and are not compatible with existing Pharo shortcuts.
Documenting such findings in this issue would be helpful. I think a good place to start implementing something is to be able to place multiple cursors with ???+click and see them in the editor, even if they don't do anything.
Thank you for the detailed explanation! I truly appreciate the guidance. I’ll begin by exploring Rubric and Album to understand how cursors and multi-cursor support are implemented. Additionally, I’ll review Pharo’s existing shortcuts to identify any potential conflicts. Documenting these findings in the issue sounds like a great starting point. Once we have a clearer understanding, we can determine the best approach for introducing multi-cursor placement.
Also, may I ask if you are the mentor for this project for GSoC 2025? It would be helpful to know whom to reach out to for further guidance. Looking forward to contributing and sharing my progress soon!
Yes, I am mentoring this project with @PalumboN. You can find the mentors and their contact at the bottom of each project's page: https://gsoc.pharo.org/code-text-improvements
Google Summer of Code with Pharo Consortium
No multi-cursor support in Rubric, which can limit productivity for users accustomed to modern editors.
Album has partial multi-cursor support, but it’s still not fully integrated or stable.
Challenges for new users:
No clear indication of multi-cursor functionality.
Lack of easy-to-access UI controls for enabling/disabling multi-cursor mode.
Inconsistent behavior between single and multi-cursor operations.
Potential confusion with Pharo’s existing text selection and navigation shortcuts.
Areas for improvement:
Standardizing cursor storage and rendering in the UI.
Adding visual indicators for multiple cursors.
Implementing basic text operations (typing, deleting, and selecting text) across multiple cursors.
Enhancing onboarding with documentation or in-editor tooltips for new users.
Ensuring compatibility with existing text editing functions in Pharo.
** Keyboard Shortcut Research**
-Pharo’s existing shortcuts need to be considered to avoid conflicts.
-Current cursor movement shortcuts in Pharo:
-Arrow Keys → Move the cursor.
-Shift + Arrow Keys → Select text.
-Cmd + Left/Right → Move to the beginning/end of the line.
-Potential multi-cursor shortcuts:
-Cmd + Click → Add a new cursor.
-Cmd + Shift + Click → Remove a cursor.
-Cmd + D → Select the next occurrence of the selected text (if feasible).
-Cmd + Shift + L → Select all occurrences of the selected text.
+ 1 to the issue
@jordanmontt @Gabriel-Darbord "Appreciate the feedback! I’m happy to see this resonates with what I’ve included in my proposal — especially around shortcut design, improving visual cues, and onboarding support for new users. Looking forward to building on it and making it even stronger if selected!"
When we are going to get the final project list @Gabriel-Darbord , i am very eager to know
Thank You