Permalink
Browse files

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

…date menus and command text
  • Loading branch information...
1 parent 19d5633 commit a46f78449a6961d6a2a1fc920da98ae8ceb89c71 jwallace committed Sep 18, 2012
Showing with 18 additions and 4 deletions.
  1. +5 −1 Default.sublime-commands
  2. +2 −1 Main.sublime-menu
  3. +11 −2 diff.py
@@ -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
@@ -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
@@ -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'])

0 comments on commit a46f784

Please sign in to comment.