Sublime Forum

add_regions with icon

#1

Try to set region:

self.view.add_regions('swi_breakpoint_active', self.lines(enabled), get_setting('breakpoint_scope'), icon=breakpoint_active_icon, flags=sublime.HIDDEN)

in console:

Unable to decode /Users/stanislav/Library/Application Support/Sublime Text 3/Packages/Web Inspector/icons/breakpoint_inactive.png

I have tried png, jpg, gif, relative and absolute paths.
in ST2 all works fine, maybe something wrong with path? or some specific icon format?

0 Likes

#2

Probably something wrong with path.
I think you must specify icon with relative path, something like:

../Web Inspector/icons/breakpoint_inactive.png

I never used it, so someone could confirm.
Or look at the existing plugins.

0 Likes

#3

ST3 is a bit different now, and a relative path is no longer required. I believe you can simply use this format (I think slashes must be forward as well) Packages/MyPlugin/MyIcon.png. My plugin BracketHighlighter uses icons now successfully in ST3 using this method.

ST2 still requires a relative bath as bizoo describes.

0 Likes

#4

[quote=“facelessuser”]ST3 is a bit different now, and a relative path is no longer required. I believe you can simply use this format (I think slashes must be forward as well) Packages/MyPlugin/MyIcon.png. My plugin BracketHighlighter uses icons now successfully in ST3 using this method.

ST2 still requires a relative bath as bizoo describes.[/quote]

Super! Thank you!

This is right path:

'Packages/Web Inspector/icons/breakpoint_active.png'
0 Likes