sublimehq / sublime_text

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

Inline phantom stops moving a cursor to the next line #6514

Open jfcherng opened 1 month ago

jfcherng commented 1 month ago

Description of the bug

When a phantom is at EOL and we tweak the width of the view by reducing ST's window size so that the phantom is wrapped into the "visual next line", you can't move the cursor to the next line by pressing key. The cursor will always be moved to the position before the phantom.

Steps to reproduce

  1. Starts ST in safe mode.

  2. Type ANYTHING and then press Enter to create an extra new line.

    image

  3. Run the following script in ST console to create an inline phantom at EOL of line 1.

    ps = sublime.PhantomSet(view); ps.update([sublime.Phantom(sublime.Region(8), 'THIS_IS_A_PHANTOM', sublime.PhantomLayout.INLINE)]);

    image

  4. Reduce window size so that the phantom is wrapped into the visual next line.

    image

  5. Move the cursor to any position of line 1.

    image

  6. Try to move to line 2 by pressing the key and you will find you can't. Keep pressing won't help.

    image

Expected behavior

The cursor can be moved to line 2.

Actual behavior

The cursor is stuck at the EOF of line 1 before the phantom.

Sublime Text build number

4183

Operating system & version

Win11 x64