Sublime Forum

Render problems with add_regions in plugins

#1

When I try to add regions with different scopes in a plugin, the cursor stops rendering, tabs get artifacts, and popup menus render without a boarder. Here is a simple example that causes problems:

[code]import sublime
import sublime_plugin

class BuildErrorsListener(sublime_plugin.EventListener):
@staticmethod
def on_selection_modified(view):
view.add_regions(“key0”, [view.line(view.text_point(0, 0))], “comment”, “dot”, sublime.HIDDEN)
view.add_regions(“key1”, [view.line(view.text_point(1, 0))], “string”, “dot”, sublime.HIDDEN)[/code]
If I enter these add_regions commands in the console, everything works as expected. It also works in the plugin if I use the same scope in both commands. Is this a bug, or am I doing something wrong?

0 Likes