Example #1
0
    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
Example #2
0
 def blame_done(self, result, position=None):
     self.scratch(
         result,
         title="Git Blame",
         position=position,
         syntax=plugin_file("syntax/Git Blame.tmLanguage")
     )
Example #3
0
    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
Example #4
0
 def details_done(self, result):
     self.scratch(
         result,
         title="Git Commit Details",
         syntax=plugin_file("syntax/Git Commit Message.tmLanguage"))
Example #5
0
 def blame_done(self, result, position=None):
     self.scratch(result,
                  title="Git Blame",
                  position=position,
                  syntax=plugin_file("syntax/Git Blame.tmLanguage"))
Example #6
0
 def log_done(self, result):
     self.scratch(result,
                  title="Git Log Graph",
                  syntax=plugin_file("syntax/Git Graph.tmLanguage"))
Example #7
0
 def details_done(self, result):
     self.scratch(result, title="Git Commit Details", syntax=plugin_file("syntax/Git Commit Message.tmLanguage"))
Example #8
0
 def log_done(self, result):
     self.scratch(result, title="Git Log Graph", syntax=plugin_file("syntax/Git Graph.tmLanguage"))