Thanks so much for this. I got the 'layoutSingle' and 'layoutDoubleHoriz' commands from the following page:
Although I don't think the page is related to the API. Given the lack of API documentation available at present, and having just started dabbling in this today, I was happy to take what I could find though
I tried using run_command with the set_layout command as you suggested, and it looks like it works fine. Here is the updated, fixed and now working version of the 'split_left_right' command posted before:
def run(self, edit):
st_window = self.view.window()
'cols': [0.0, 0.5, 1.0],
'rows': [0.0, 1.0],
'cells': [0, 0, 1, 1], [1, 0, 2, 1]]
st_window.set_view_index(st_window.active_view(), 1, 0)
It's useful to know that run_command takes the same format of commands as those used in the keybindings files – am sure this will come in useful for my continued ventures into plugin development
If anyone knows of any better way of doing this, then I'd be very interested However, this approach seems to work, so am very happy with using it for now.
By the way, I'm throwing together a plugin to emulate 'emacs style' window splitting using the standard emacs keybindings. Will try and make a release when I'm done and it all goes well.