Skip to content

Add vertically aligned multi-caret creation via Alt+Up/Down and Alt+Drag#125

Draft
Copilot wants to merge 13 commits into
developfrom
copilot/add-vertically-aligned-carets
Draft

Add vertically aligned multi-caret creation via Alt+Up/Down and Alt+Drag#125
Copilot wants to merge 13 commits into
developfrom
copilot/add-vertically-aligned-carets

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

  • Triage new maintainer feedback about primary caret disappearing after exiting multi-caret mode
  • Inspect recent GitHub Actions runs/logs for related CI failures
  • Reproduce with failing-first regression test for caret visibility after exiting multi-caret mode
  • Implement minimal fix for primary caret visibility/state after clearing multi-caret mode
  • Run focused regression tests, then full format/build/test validation
  • Run final parallel validation and reply to maintainer comment with commit hash + screenshot

Copilot AI assigned Copilot and tig May 15, 2026
Copilot AI linked an issue May 15, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add support for vertically aligned carets Add vertically aligned multi-caret creation via Alt+Up/Down and Alt+Drag May 15, 2026
Copilot finished work on behalf of tig May 15, 2026 16:01
Copilot AI requested a review from tig May 15, 2026 16:01
@tig tig marked this pull request as ready for review May 15, 2026 16:07
@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot this is basically non-functional.

The first time I use it, it basically works. But then alll cursor/caret managemnt is messed up. Invest in tests that fail before trying to fix.

@tig tig marked this pull request as draft May 15, 2026 16:34
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot this is basically non-functional.

The first time I use it, it basically works. But then alll cursor/caret managemnt is messed up. Invest in tests that fail before trying to fix.

Fixed in d46907b with a failing-first regression test and a caret-state normalization fix.

What was failing first: after creating vertical carets, moving the primary caret onto an additional caret caused duplicate inserts at one location (aa\naxxa\naxa).

What changed in d46907b:

  • Added regression test Vertical_MultiCaret_Does_Not_Duplicate_When_Primary_Moves_Onto_Additional.
  • Added NormalizeAdditionalCarets() to remove deleted/duplicate additional carets and any additional caret that overlaps the primary.
  • Run normalization on caret movement and document-change paths.

Screenshot artifact: vertical-caret-fix

Copilot finished work on behalf of tig May 15, 2026 16:41
@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot still very broken. Eg after dismissing multi-caret, main caret won't move below where last mulit was.

Tabs don't insert at all carets.

Similar issues as before with carets being placed -1 column from row above when alt-down is pressed in some cases.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot still very broken. Eg after dismissing multi-caret, main caret won't move below where last mulit was.

Tabs don't insert at all carets.
...

Addressed in f5d2f75 (with additional regression coverage in 2c1f655).

  • Fixed Tab so it inserts at all carets (Tab_Inserts_At_All_Carets was failing before this).
  • Added/kept regression guards for dismissal + subsequent Down movement and for Alt+Down column stability (including tabbed lines and short-line restoration).
  • Stabilized vertical block target column when starting Alt+Up/Down blocks and refreshed sticky column when multi-carets are cleared.

Screenshot artifact: vertical-multicaret-followup

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.jetbrains.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.unix.runtimeconfig.json /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.exe Terminal.Gui.Editor.slnx --profile=TG.Editor Full Cleanup (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.unix.runtimeconfig.json /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.exe Terminal.Gui.Editor.slnx --profile=TG.Editor Full Cleanup --no-build --exclude=third_party/**/* (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of tig May 15, 2026 17:33
@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot when verit carets are active, trying to add another caret with ctrl-click puts it in the wrong location. This occurs even after a vert caret operation has ended.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot when verit carets are active, trying to add another caret with ctrl-click puts it in the wrong location. This occurs even after a vert caret operation has ended.

Fixed in 7b0013c.

I added a failing-first regression (CtrlClick_After_VerticalCarets_Uses_Click_Position_When_PositionReport_Arrives_First) and fixed mouse handling so Ctrl+PositionReport drag events no longer move the primary caret before the Ctrl+click toggle is processed.

Screenshot artifact: ctrl-click-after-vertical-carets

Copilot finished work on behalf of tig May 15, 2026 17:53
@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot tabs are not working right. I vertically select 3 rows and press tab. adds 4 spaces as expected. hit tab again, get this:

image

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot tabs are not working right. I vertically select 3 rows and press tab. adds 4 spaces as expected. hit tab again, get this:

<img width="265" height="55" alt="image" src="https://github.com/u...

Fixed in 9bc1c57.

I added a failing-first regression (Tab_Twice_Inserts_Consistently_At_All_Vertical_Carets_With_Spaces) and fixed visual-line cache invalidation so repeated Tab in vertical multi-caret mode keeps all carets aligned on subsequent presses.

Screenshot artifact: tab-twice-vertical-carets-fix

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.jetbrains.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.unix.runtimeconfig.json /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.exe Terminal.Gui.Editor.slnx --profile=TG.Editor Full Cleanup (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.unix.runtimeconfig.json /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.exe Terminal.Gui.Editor.slnx --profile=Built-in: Full Cleanup --no-build --exclude=third_party/**/* (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of tig May 15, 2026 18:22
@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot now the main cursor/caret disappears after exiting mult mode.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot now the main cursor/caret disappears after exiting mult mode.

I’m not able to reproduce this yet on the current head. Can you share the exact exit action you’re using (Esc, click, or another key), plus whether this is in ted or the integration host?

If you can include a short key sequence from a fresh buffer (e.g. starting text + exact keys), I’ll add a failing regression test for it and patch immediately.

Screenshot reference: https://github.com/user-attachments/assets/0be9cbdd-0994-419c-a667-0e5772ff94f0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor should support vertically aligned carets

2 participants