[Suggestion] Edit on the right
BarbzYHOOL opened this issue · 2 comments
Like in sidebarenhancements, edit on the right, open a second panel
(however I don't know how to close it lol)
The implementation in SideBarEnhancements is a bit naive in that it simply forces a 2-pane layout and moves the file to the second pane. If you already have a multi-pane layout, that's now gone.
Nowadays we also have Sublime Text 4, and you can command-click a file in the sidebar to open it in a split view. So in a sense you already have this feature.
But maybe existing layouts can be resolved in an elegant way that would make it a nice addition to this package. I'm going to leave this here for now, maybe someone can pick this up and improve on it.
class SideBarOpenSplitCommand(MultipleFilesMixin, SideBarCommand):
def run(self, paths):
window = self.window
window.run_command(
"set_layout",
{
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]],
},
)
window.focus_group(1)
paths = self.get_paths(paths)
for path in paths:
view = sublime.active_window().open_file(path)
view.settings().set("open_with_edit", True)
window.set_view_index(view, 1, 0)
def is_visible(self, paths):
paths = self.get_paths(paths)
for path in paths:
if os.path.isdir(path):
return False
return True
def description(self):
return 'Open File In New Group'
I’ll class this as “won’t fix” because packages and features already exist to manage multiple panes, and interfacing with that is out of scope for this package.