I’m using add_regions(…) to add three differently named regions, different for three different lines. Problems is that only one of those icons is actually rendered. Or that’s what I see most of the time, it’s a bit random.
I’ve made some minimal test for this. Add this plugin:
[code]import sublime
import sublime_plugin
class OpenNewViewBugTestCommand(sublime_plugin.TextCommand):
def run(self, edit):
new_view = self.view.window().new_file()
new_view.insert(
edit,
0,
‘There should be three different coloured dots in the gutter.\n’
‘\na\nb\nc\n’)
lines_regions = new_view.lines(sublime.Region(0, new_view.size()))
new_view.add_regions(‘region1’,
[lines_regions[2]],
scope=‘comment’,
icon=‘circle’,
flags=sublime.HIDDEN)
new_view.add_regions(‘region2’,
[lines_regions[3]],
scope=‘markup.inserted’,
icon=‘circle’,
flags=sublime.HIDDEN)
new_view.add_regions(‘region3’,
[lines_regions[4]],
scope=‘markup.deleted’,
icon=‘circle’,
flags=sublime.HIDDEN)
[/code]
and run this code from the ST console to trigger it:
sublime.active_window().active_view().run_command('open_new_view_bug_test')
I see one dot, on one line. I expect three on three lines.
Changing scope of the first region to something invalid (like ‘foo’) makes the dot show up but obviously not with the color I want.
Sublime 3.3062 Windows
EDIT: Updated bug testcase incorporating facelessuser changes.