PythonBreakpoints icon indicating copy to clipboard operation
PythonBreakpoints copied to clipboard

Circle in gutter persists after removing breakpoint (even after removing package)

Open Gabriel-p opened this issue 10 years ago • 9 comments

I've tried everything to remove them but the white circles just won't go away. The break point is long gone, but they remain.

I've: set "gutter_icon": "", disabled the package, and even removed the package altogether. After restarting Sublime, they are still there.

What do I need to do to remove them?

captura de pantalla de 2016-01-04 19 57 55

Gabriel-p avatar Jan 04 '16 23:01 Gabriel-p

It means you've removed the breakpoint by deleting the line instead of using the Toggle breakpoint command. I did some experiments and haven't found a way to remove such orphaned gutter icon programmatically, it appears to be the issue with ST and not with the plugin.

obormot avatar Jan 06 '16 17:01 obormot

OK, but how do I remove the left-over gutter icons programmatically or not?

I've tried adding a BP on the same line and then removing it with the toggle, but the icons are still there.

What do I need to modify/delete/add to whatever file to make those icons go away?

Gabriel-p avatar Jan 06 '16 18:01 Gabriel-p

The gutter icon is a named "region" in ST's terms. Since you've deleted the breakpoint, the name of the region is now lost. I haven't found an API that allows searching for region names. If you knew the name you could've deleted it, but since the name is lost there's no programmatic way of doing it.

obormot avatar Jan 07 '16 13:01 obormot

@obormot let me get this straight. Are you telling me I need to remove Sublime completely from my system and then re-install it, to undo something your package did?

Please tell me this isn't true.

Gabriel-p avatar Jan 07 '16 20:01 Gabriel-p

Ahem... what?! Your issue was not caused by the plugin. The plugin calls ST API to add and remove the gutter icon correctly. By killing the breakpoint incorrectly you've created an orphaned named region that is now unknown to the plugin. Blaming the plugin for this isn't right. Have you tried restarting the editor? ST documentation says that sublime.PERSISTENT flag saves the regions in the session. Also, have you tried renaming the file, or doing any other trick so that ST "forgets" the association of this gutter icon and your file.

obormot avatar Jan 07 '16 21:01 obormot

Restarting Sublime was the first thing I checked, and it doesn't work. What does work is closing and re-opening the file (each file with this issue), which I thought of doing thanks to your above comment. I would've guessed closing ST was equivalent to closing the file, obviously it is not.

Your plugin is great, but the issue is definitely caused by it. It'd be silly to say "ST created this problem" when it was clearly using the plugin what did.

If you ask me, this should be added to the 'Caveats' section of the README.

Thanks again.

Gabriel-p avatar Jan 07 '16 21:01 Gabriel-p

No problem. I will add this to Caveats in the next release.

obormot avatar Jan 07 '16 22:01 obormot

There must be a way around this... @obormot

The gutter icon is a named "region" in ST's terms. Since you've deleted the breakpoint, the name of the region is now lost.

The name is lost to the plugin? How are the names being stored/found? If ST knows the name and the plugin does not, all that really needs to be done is find a way to fill that knowledge gap. Maybe store these region names somehow?

Can you provide more info about the issue?

hyatt-e avatar Jan 29 '19 15:01 hyatt-e

@hyatt-e if you look at STs API reference, there's literally no way to list/find regions in the file https://www.sublimetext.com/docs/3/api_reference.html I don't know how and where ST internally stores the regions There's probably a way to redesign this but I couldn't find a straightforward method using the ST API. This issue is annoying and I tried to hack it but had zero luck with existing API.

obormot avatar Feb 10 '19 02:02 obormot