Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

o/O interact badly with multiple cursors #12558

Closed
loewenheim opened this issue Jan 16, 2025 · 3 comments
Closed

o/O interact badly with multiple cursors #12558

loewenheim opened this issue Jan 16, 2025 · 3 comments
Labels
C-bug Category: This is a bug

Comments

@loewenheim
Copy link
Contributor

Summary

Having multiple cursors on different lines and pressing o/O to insert a line beneath/above each of them behaves unexpectedly, see below for details. I suspect there is a calculation for how many characters each cursor needs to be moved forward that gets messed up by the lines being inserted.

Reproduction Steps

o case

  1. Have a file with two lines, say
foo
bar
  1. Have a cursor on of each line
  2. Press o

Expected

foo
|
bar
|

(| is a cursor)

Actual

foo
|
bar|

The second newline is inserted, but the cursor isn't moved to it, it's moved to the end of the current line. It doesn't matter which cursor is the primary, only the order in the file matters. The result for 3 lines is even weirder:

foo
bar
baz

becomes

foo
|
bar|

ba|z

O case:

Setup as above, but press O

Expected

|
foo
|
bar

Actual

|
foo|

bar

Helix log

Platform

macOS 15.0.1

Terminal Emulator

kitty 0.34.1

Installation Method

flake

Helix Version

helix 25.01 (e01775a)

@loewenheim loewenheim added the C-bug Category: This is a bug label Jan 16, 2025
@TornaxO7
Copy link
Contributor

TornaxO7 commented Jan 16, 2025

Duplicate of #12448. Fix is already merged in master.

@loewenheim
Copy link
Contributor Author

Thanks for the quick action. I tried looking for a duplicate but missed it 🙇

@TornaxO7
Copy link
Contributor

Thanks for the quick action. I tried looking for a duplicate but missed it 🙇

No problem. Happens

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants