sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
809 stars 39 forks source link

When adding a caret to an adjacent line, sometimes, two carets are added. #3951

Closed matj1 closed 10 months ago

matj1 commented 3 years ago

Description

When I use a proportional font, if I place a caret on a line and press Alt+Shift+Up or Alt+Shift+Down, there is a chance that two carets are added to the line, not just one. It probably depends on where the characters' borders on the adjacent line are in relation to the position of the caret before the action.

ST_carets_full

I did what is shown in the image by having a single caret in the buffer, the one in hardware_acceleration at the bottom, and holding Alt+Shift+Up as long as more carets were appearing.

Edit: If I use a monospaced font and repeat this, multiple carets appear around "EnhancedReadline" and above. It is probably caused by the caret being added to the short line ],, but new carets still being added above the ones far from the beginning of a line.

This occurred in Sublime text 3 and build 4098. The fonts with which I tried it are Input Sans Narrow, Linux Biolinum and DejaVu Sans.

Steps to reproduce

  1. Have a buffer with a good variation in characters and multiple lines.
  2. Have it displayed in a proportional font.
  3. Place a caret to a position where a lot of text is above or below it.
  4. Press repeatedly or hold Alt+Shift+{Up,Down} (or what you have it rebound to), depending on the direction of the lot of text.

Expected behavior

Each line should have only one caret.

Actual behavior

Some lines have multiple carets.

Environment

deathaxe commented 3 years ago

Nasty long lasting bug. I don't recall where but there shoul even exist an issue for that, already.

You can work around it via https://packagecontrol.io/packages/Column%20Select

matj1 commented 3 years ago

The behavior from the plugin should be the default. (Edit: in my opinion)

deathaxe commented 3 years ago

It just should play better together with scroll_context_lines setting. The most recently added caret should always cause scrolling instead of it leaving the view or causeing scroll position to move suddenly when hitting the view's edge.

valeriesubl commented 10 months ago

This was fixed in build 4155.