Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phantoms with empty regions are not removed when encompassing selection is deleted #5410

Open
jwortmann opened this issue May 21, 2022 · 0 comments

Comments

@jwortmann
Copy link

Description of the bug

When you delete a selection containing a phantom with an empty region, the phantom doesn't get removed.

Steps to reproduce

  1. Start ST in safe mode.

  2. Add for example the following text into a view:

    abcdefghijklmnopqrstuvwxyz
    
  3. Paste into the ST console:

    >>> ps = sublime.PhantomSet(view, "inlay_hint")
    >>> ps.update([sublime.Phantom(sublime.Region(10,10), '<body><style>.inlay-hint {color:color(var(--foreground) alpha(0.6));background-color:color(var(--foreground) alpha(0.08));border-radius:4px;padding:0.05em 4px;font-size:0.9em;}</style><div class="inlay-hint">inlay hint:</div></body>', sublime.LAYOUT_INLINE)])
  4. Select a part of the text containing the phantom, for example from the letters i to l

    step4

  5. Press Del or Backspace to delete the selection

Expected behavior

The phantom gets removed.

Actual behavior

The phantom which was contained in the deleted selection still persist.


Note that if the phantom's region isn't empty (for example change sublime.Region(10,10) to sublime.Region(10,11)), the phantom will be removed as expected.

Sublime Text build number

4126

Operating system & version

Windows 10

(Linux) Desktop environment and/or window manager

No response

Additional information

Real world example:

phantoms

The phantoms persist until they are manually removed via e.g. my_phantom_set.update([]).

OpenGL context information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants