sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

`find_under_expand` resets horizontal scroll

Open istudyatuni opened this issue 1 month ago • 2 comments

Description of the bug

When word wrap is disabled and you scrolled to the right, selecting several occurrences of something with ctrl+d scrolls to the left

It doesn't scroll to the left if cursors are further than 1 width apart

Steps to reproduce

  1. Start Sublime in safe mode
  2. Create line of dots with the size of 2 editor view's width
  3. "Word Wrap: Toggle"
  4. Select dot in the second quarter of line
  5. Scroll to the right
  6. Press ctrl+d

Expected behavior

Next dot is selected without scrolling to the left

Actual behavior

Next dot is selected and view is scrolled to the left

Sublime Text build number

4200

Operating system & version

NixOS unstable

(Linux) Desktop environment and/or window manager

Sway

Additional information

No response

OpenGL context information


istudyatuni avatar Dec 07 '25 08:12 istudyatuni

Scroll position is not reset, but viewport is moved in all directions to reveal newly added selections.

I'd say that's intentional behavior as it is crucial to be able to verify whether new selection is desirable or needs to be skipped via ctrl+k,ctrl+d.

deathaxe avatar Dec 07 '25 10:12 deathaxe

it is crucial to be able to verify whether new selection is desirable or needs to be skipped

Viewport is scrolled even when next possible selection is on the same line, but not scrolled, when selection can't be repeated on the same line. E.g. ([.] means selection, [.][.] means previous and new (after ctrl+d) selection):

          |          // viewport
............[.][.].. // scrolled

                     |            // 2x viewport
...........................[.][.] // not scrolled

istudyatuni avatar Dec 07 '25 11:12 istudyatuni