# Buggy code
def run_async(self, commit_message=None):
    if commit_message is None:
        view_text = self.view.substr(sublime.Region(0, self.view.size()))
        help_text = self.view.settings().get("git_savvy.commit_view.help_text")
        commit_message = view_text.split(help_text)[0]

    include_unstaged = self.view.settings().get(
        "git_savvy.commit_view.include_unstaged"
    )

    show_panel_overrides = sublime.load_settings("GitSavvy.sublime-settings").get(
        "show_panel_for"
    )

    self.git(
        "commit",
        "-q" if "commit" not in show_panel_overrides else None,
        "-a" if include_unstaged else None,
        "--amend" if self.view.settings().get("git_savvy.commit_view.amend") else None,
        "-F",
        "-",
        stdin=commit_message,
    )

    # ensure view is not already closed (i.e.: when "commit_on_close" enabled)
    is_commit_view = self.view.settings().get("git_savvy.commit_view")
    if is_commit_view and self.view.window():
        self.view.window().focus_view(self.view)
        self.view.set_scratch(True)  # ignore dirty on actual commit
        self.view.window().run_command("close_file")
    else:
        sublime.set_timeout_async(
            lambda: util.view.refresh_gitsavvy(sublime.active_window().active_view())
        )


# Traceback (RuntimeError)
Traceback (most recent call last):
File "core.git_command in /Users/user/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package", line 103, in git
File "core.git_command in /Users/user/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package", line 297, in repo_path
RuntimeError: Window does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "core.commands.commit in /Users/user/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package", line 142, in <lambda>
File "core.commands.commit in /Users/user/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package", line 162, in run_async
File "core.git_command in /Users/user/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package", line 106, in git
File "core.exceptions in /Users/user/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package", line 7, in __init__
TypeError: GitSavvyError does not take keyword arguments

# Fixed code
def run_async(self, commit_message=None):
    if commit_message is None:
        view_text = self.view.substr(sublime.Region(0, self.view.size()))
        help_text = self.view.settings().get("git_savvy.commit_view.help_text")
        commit_message = view_text.split(help_text)[0]

    include_unstaged = self.view.settings().get(
        "git_savvy.commit_view.include_unstaged"
    )

    show_panel_overrides = sublime.load_settings("GitSavvy.sublime-settings").get(
        "show_panel_for"
    )

    self.git(
        "commit",
        "-q" if "commit" not in show_panel_overrides else None,
        "-a" if include_unstaged else None,
        "--amend" if self.view.settings().get("git_savvy.commit_view.amend") else None,
        "-F",
        "-",
        stdin=commit_message,
    )

    is_commit_view = self.view.settings().get("git_savvy.commit_view")
    if is_commit_view and not self.commit_on_close:
        self.view.window().focus_view(self.view)
        self.view.set_scratch(True)  # ignore dirty on actual commit
        self.view.window().run_command("close_file")

    sublime.set_timeout_async(
        lambda: util.view.refresh_gitsavvy(sublime.active_window().active_view())
    )