Hi. I tried to make a plugin that will open new tabs on the right. (Instead of next to the currently active tab.)
My plugin sort-of works, but it seems like the actual tabs aren’t redrawn; the GUI does not change. I can’t figure out how to fix this
Maybe someone on this forum can help me?
import sublime, sublime_plugin
class TabrightEvent(sublime_plugin.EventListener):
def __init__(self, *args, **kwargs):
super(TabrightEvent, self).__init__(*args, **kwargs)
self.new_buffers = ]
def on_new(self,view):
self.new_buffers.append(view.buffer_id())
def on_activated(self, view):
# print 'on_activated', self.last_syntax, view.buffer_id()
if view.buffer_id() in self.new_buffers:
self.new_buffers.remove(view.buffer_id())
window = view.window()
group = window.active_group()
viewcount = len(window.views()) - 1
window.set_view_index(view, group, viewcount)
window.focus_view(view)