From 39cfd234ea84aa814137fb150c6909c99cd93ac3 Mon Sep 17 00:00:00 2001 From: Koen De Hondt Date: Tue, 27 Oct 2026 12:38:36 +0100 Subject: [PATCH 1/4] Support multiple cursors. --- .../AlbTextEditorExamples.class.st | 33 ++ src/Album-Tests/AlbMultiCursorTest.class.st | 470 ++++++++++++++++++ .../AlbTextEditorHistoryTest.class.st | 42 ++ .../AlbTextEditorInserterTest.class.st | 2 +- src/Album/AlbEditableMode.class.st | 2 + .../AlbEditorAddCursorAboveShortcut.class.st | 46 ++ .../AlbEditorAddCursorBelowShortcut.class.st | 46 ++ .../AlbEditorDeselectAllShortcut.class.st | 6 +- src/Album/AlbTextEditor.class.st | 52 +- ...AlbTextEditorAbstractSegmentPiece.class.st | 100 ++-- src/Album/AlbTextEditorDeleter.class.st | 108 ++-- ...ditorHistoryCursorMovementCommand.class.st | 21 +- src/Album/AlbTextEditorInserter.class.st | 92 ++-- .../AlbTextEditorLineSegmentHolder.class.st | 4 +- src/Album/AlbTextEditorMouseHandler.class.st | 9 + src/Album/AlbTextEditorNavigator.class.st | 198 ++++++-- src/Album/AlbTextEditorPaster.class.st | 6 +- src/Album/AlbTextEditorSelecter.class.st | 2 + .../AlbTextEditorShowCursorRequest.class.st | 15 +- src/Album/AlbTextElement.class.st | 126 +++-- ...AlbTextWordPieceShowCursorHandler.class.st | 11 +- 21 files changed, 1139 insertions(+), 252 deletions(-) create mode 100644 src/Album-Tests/AlbMultiCursorTest.class.st create mode 100644 src/Album/AlbEditorAddCursorAboveShortcut.class.st create mode 100644 src/Album/AlbEditorAddCursorBelowShortcut.class.st diff --git a/src/Album-Examples/AlbTextEditorExamples.class.st b/src/Album-Examples/AlbTextEditorExamples.class.st index 35049f5..e03617c 100644 --- a/src/Album-Examples/AlbTextEditorExamples.class.st +++ b/src/Album-Examples/AlbTextEditorExamples.class.st @@ -180,6 +180,39 @@ AlbTextEditorExamples class >> exampleMethodTextOpenEmbedElement [ space show ] +{ #category : #examples } +AlbTextEditorExamples class >> exampleMultiCursorEditing [ + "Open an editor with a cursor at the start of every line: type to edit all lines at once. + Alt-click (Option-click on macOS) toggles a cursor, + Ctrl+Alt+Up/Down (Cmd+Option+Up/Down on macOS) adds a cursor above/below, + Escape keeps only the primary cursor" + +