AvaloniaUI / AvaloniaEdit

Avalonia-based text editor (port of AvalonEdit)
MIT License
746 stars 148 forks source link

Pressing `End` to go to the end of the line ignores multi-character trailing whitespace #428

Open Rekkonnect opened 4 months ago

Rekkonnect commented 4 months ago

Steps

  1. Run the demo project found in this repo (AvaloniaEdit.Demo)
  2. Type multiple spaces at the end of any line
  3. Make sure "View spaces" is disabled
  4. Press Home and End

Expected

The caret is placed at the end of the line, right next to the last whitespace character.

Actual

The caret does not go to the final whitespace character, it only surpasses the first one.

Example

https://github.com/AvaloniaUI/AvaloniaEdit/assets/8298332/690b2f76-5f2b-4d1b-9ce2-4cbfd9cf2c3b

This works as expected when spaces are visible.