I’m writing a plugin, and want to preview two files side-by-side when scrolling through a quick_view list.
This works fine for a single file preview (this code would be in the on_changed function passed to the quick_view):
self.preview = self.window.open_file(
file_desc,
sublime.TRANSIENT | sublime.ENCODED_POSITION)
But if I want to change the layout to have 2 groups, then preview a second file in the new group, then my plugin is terminated.
self.window.set_layout(
{"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 1.0],
"cells": [0, 0, 1, 1], [1, 0, 2, 1]]})
self.preview = self.window.open_file(
file_desc1,
flags=sublime.TRANSIENT | sublime.ENCODED_POSITION)
self.preview = self.window.open_file(
file_desc2,
flags=sublime.TRANSIENT | sublime.ENCODED_POSITION | sublime.FORCE_GROUP,
group=1)
I suspect this is something to do with the quick_view being associated with a specific view, and doing anything with another view terminates the quick_view. But that’s pure conjecture.
I’ve tried various things to try and work this out, and as you can see my digging has led me to some undocumented options: “sublime.FORCE_GROUP” and “group=1”, but nothing seems to let me put a preview in group 1 while keeping the quick_view active.
Any help/advice greatly appreciated.