Open CptPotato opened 1 year ago
cc @dead10ck
I'm unable to reproduce the issue with these steps. @pascalkuthe would you be able to give it a shot just so we can rule out that I'm doing something wrong?
Oh actually I was using my personal branch. I am able to reproduce from the latest master. This makes me suspect that it's already fixed by #7269
Edit: yep, confirmed, this is fixed by #7269
Oh actually I was using my personal branch. I am able to reproduce from the latest master. This makes me suspect that it's already fixed by
#7269
Ah nice, I can check later if this fixes the auto-pair issues.
Summary
When using multiple selections and
crlf
line endings, auto pairs can cause selections to shift when inserting on the newline character.Reproduction Steps
Open a new file with this content:
:line-ending crlf
%<Alt+s>
A
(nota
)(
The result is this (each auto pair causes the following selections' anchor to shift):
All selections should remain 1 character wide instead.
Helix log
log
```js 2023-08-23T10:20:55.527 helix_core::auto_pairs [DEBUG] auto pair transaction: Transaction { changes: ChangeSet { changes: [ Retain( 6, ), Insert( "()", ), Retain( 8, ), Insert( "()", ), Retain( 8, ), Insert( "()", ), Retain( 8, ), Insert( "()", ), Retain( 2, ), ], len: 32, len_after: 40, }, selection: Some( Selection { ranges: [ Range { anchor: 7, head: 8, old_visual_position: None, }, Range { anchor: 15, head: 18, old_visual_position: None, }, Range { anchor: 23, head: 28, old_visual_position: None, }, Range { anchor: 31, head: 38, old_visual_position: None, }, ], primary_index: 0, }, ), } ```Platform
Windows
Terminal Emulator
wezterm (20230712-072601)
Helix Version
master at 929eb0c39e34f8046b5ec9ecfede4ec80b5e0c8a