randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.39k stars 81 forks source link

Open Default Shell in Split Tab Bug #197

Closed nullchilly closed 4 years ago

nullchilly commented 4 years ago
[
    {
        "caption": "Terminus: Open Default Shell in Split Tab",
        "command": "terminus_open",
        "args": {
            "post_window_hooks": [
                ["carry_file_to_pane", {"direction": "down"}]
            ]
        }
    }
]

if there are >= 1 tab on the right of current tab in left pane

then calling this command will change the current tab to adjacent tab

I believe this is how origami function, how can I fix this?

nullchilly commented 4 years ago

noob fix. go to /home/tuna/.config/sublime-text-3/Installed Packages/Origami.sublime-package/origami.py search def carry_file_to_pane(self, direction, create_new_if_necessary=False): function change the content into

def carry_file_to_pane(self, direction, create_new_if_necessary=False):
        window = self.window;
        active_group = window.active_group()
        views_in_group = window.views_in_group(active_group)
        view = window.active_view()
        preview = views_in_group[window.get_view_index(view)[1] - 1]
        if view == None:
            # If we're in an empty group, there's no active view
            return
        revert = 1
        if window.get_view_index(view)[1] == len(views_in_group) - 1:
            revert = 0
        self.travel_to_pane(direction, create_new_if_necessary)
        window = self.window
        active_group = window.active_group()
        views_in_group = window.views_in_group(active_group)
        window.set_view_index(view, active_group, len(views_in_group))
        sublime.set_timeout(lambda: window.focus_view(view))
        if revert == 1:
            self.travel_to_pane(opposite_direction(direction), create_new_if_necessary)
            window = self.window
            window.focus_view(preview)
            self.travel_to_pane(direction, create_new_if_necessary)