Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add DiffTool Current File, and Diff Tool All as seperate commands. Up…

…date menus and command text
  • Loading branch information...
commit a46f78449a6961d6a2a1fc920da98ae8ceb89c71 1 parent 19d5633
jwallace authored
Showing with 18 additions and 4 deletions.
  1. +5 −1 Default.sublime-commands
  2. +2 −1  Main.sublime-menu
  3. +11 −2 diff.py
View
6 Default.sublime-commands
@@ -47,10 +47,14 @@
"command": "git_diff_commit"
}
,{
- "caption": "Git: Diff Tool",
+ "caption": "Git: Diff Tool Current File",
"command": "git_diff_tool"
}
,{
+ "caption": "Git: Diff Tool All",
+ "command": "git_diff_tool_all"
+ }
+ ,{
"caption": "Git: Commit",
"command": "git_commit"
}
View
3  Main.sublime-menu
@@ -15,6 +15,7 @@
,{ "caption": "Graph", "command": "git_graph" }
,{ "caption": "-" }
,{ "caption": "Diff", "command": "git_diff" }
+ ,{ "caption": "DiffTool", "command": "git_diff_tool" }
,{ "caption": "-" }
,{ "caption": "Add", "command": "git_add" }
,{ "caption": "Add Selected Hunk", "command": "git_add_selected_hunk" }
@@ -39,7 +40,7 @@
,{ "caption": "-" }
,{ "caption": "Diff", "command": "git_diff_all" }
,{ "caption": "Diff Staged", "command": "git_diff_commit" }
- ,{ "caption": "Diff Tool", "command": "git_diff_tool" }
+ ,{ "caption": "Diff Tool", "command": "git_diff_tool_all" }
,{ "caption": "Reset Hard", "command": "git_reset_hard_head" }
,{ "caption": "-" }
,{ "caption": "Add...", "command": "git_add_choice" }
View
13 diff.py
@@ -5,7 +5,7 @@
class GitDiff (object):
def run(self, edit=None):
self.run_command(['git', 'diff', '--no-color', '--', self.get_file_name()],
- self.diff_done)
+ self.diff_done)
def diff_done(self, result):
if not result.strip():
@@ -48,6 +48,15 @@ class GitDiffCommitCommand(GitDiffCommit, GitWindowCommand):
pass
-class GitDiffTool(GitWindowCommand):
+class GitDiffTool(object):
+ def run(self, edit=None):
+ self.run_command(['git', 'difftool', '--', self.get_file_name()])
+
+
+class GitDiffToolCommand(GitDiffTool, GitTextCommand):
+ pass
+
+
+class GitDiffToolAll(GitWindowCommand):
def run(self):
self.run_command(['git', 'difftool'])
Please sign in to comment.
Something went wrong with that request. Please try again.