def diff_done(self, result): settings = sublime.load_settings("Git.sublime-settings") historySize = settings.get('history_size') def format(line): return '# ' + line.replace("\n", " ") if not len(self.lines): self.lines = ["", ""] self.lines.extend(map(format, history[:historySize])) self.lines.extend([ "# --------------", "# Please enter the commit message for your changes. Everything below", "# this paragraph is ignored, and an empty message aborts the commit.", "# Just close the window to accept your message.", result.strip() ]) template = "\n".join(self.lines) msg = self.window.new_file() msg.set_scratch(True) msg.set_name("COMMIT_EDITMSG") self._output_to_view( msg, template, syntax=plugin_file("syntax/Git Commit Message.tmLanguage")) msg.sel().clear() msg.sel().add(sublime.Region(0, 0)) GitCommitCommand.active_message = self
def blame_done(self, result, position=None): self.scratch( result, title="Git Blame", position=position, syntax=plugin_file("syntax/Git Blame.tmLanguage") )
def diff_done(self, result): settings = sublime.load_settings("Git.sublime-settings") historySize = settings.get('history_size') def format(line): return '# ' + line.replace("\n", " ") if not len(self.lines): self.lines = ["", ""] self.lines.extend(map(format, history[:historySize])) self.lines.extend([ "# --------------", "# Please enter the commit message for your changes. Everything below", "# this paragraph is ignored, and an empty message aborts the commit.", "# Just close the window to accept your message.", result.strip() ]) template = "\n".join(self.lines) msg = self.window.new_file() msg.set_scratch(True) msg.set_name("COMMIT_EDITMSG") self._output_to_view(msg, template, syntax=plugin_file("syntax/Git Commit Message.tmLanguage")) msg.sel().clear() msg.sel().add(sublime.Region(0, 0)) GitCommitCommand.active_message = self
def details_done(self, result): self.scratch( result, title="Git Commit Details", syntax=plugin_file("syntax/Git Commit Message.tmLanguage"))
def blame_done(self, result, position=None): self.scratch(result, title="Git Blame", position=position, syntax=plugin_file("syntax/Git Blame.tmLanguage"))
def log_done(self, result): self.scratch(result, title="Git Log Graph", syntax=plugin_file("syntax/Git Graph.tmLanguage"))
def details_done(self, result): self.scratch(result, title="Git Commit Details", syntax=plugin_file("syntax/Git Commit Message.tmLanguage"))