Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow diff ignoring whitespaces!, update buffer scroll API call

  • Loading branch information...
commit 7f5b5d0686f5bf504300c320a1b3bde3fad6a550 1 parent 3f23529
@titoBouzout authored
View
1  Context.sublime-menu
@@ -23,6 +23,7 @@
"children":
[
{ "caption": "all changes since the last commit", "command": "side_bar_git_diff_all_changes_since_last_commit", "args": {"paths": []} },
+ { "caption": "all changes since the last commit ( ignore whitespace )", "command": "side_bar_git_diff_all_changes_since_last_commit_ignore_white_space", "args": {"paths": []} },
{ "caption": "-"},
{ "caption": "changes that have not been staged", "command": "side_bar_git_diff_changes_not_staged", "args": {"paths": []} },
{ "caption": "changes that are staged but not committed", "command": "side_bar_git_diff_changes_staged_not_commited", "args": {"paths": []} },
View
1  Side Bar.sublime-menu
@@ -23,6 +23,7 @@
"children":
[
{ "caption": "all changes since the last commit", "command": "side_bar_git_diff_all_changes_since_last_commit", "args": {"paths": []} },
+ { "caption": "all changes since the last commit ( ignore whitespace )", "command": "side_bar_git_diff_all_changes_since_last_commit_ignore_white_space", "args": {"paths": []} },
{ "caption": "-"},
{ "caption": "changes that have not been staged", "command": "side_bar_git_diff_changes_not_staged", "args": {"paths": []} },
{ "caption": "changes that are staged but not committed", "command": "side_bar_git_diff_changes_staged_not_commited", "args": {"paths": []} },
View
27 SideBarGitCommands.py
@@ -8,10 +8,9 @@
from Utils import Object, uniqueList
try:
- from BufferScroll import BufferScroll
- BufferScroll = BufferScroll()
+ from BufferScroll import BufferScrollAPI
except:
- BufferScroll = False
+ BufferScrollAPI = False
#run last command again on a focused tab when pressing F5
@@ -37,11 +36,11 @@ def run(self):
view.settings().get('SideBarGitSyntaxFile')
)
else:
- if BufferScroll:
- BufferScroll.save(view, 'sidebar-git');
+ if BufferScrollAPI:
+ BufferScrollAPI.save(view, 'sidebar-git');
view.run_command("revert")
- if BufferScroll:
- BufferScroll.restore(view, 'sidebar-git');
+ if BufferScrollAPI:
+ BufferScrollAPI.restore(view, 'sidebar-git');
#Following code for selected files or folders
@@ -59,6 +58,20 @@ def run(self, paths = []):
def is_enabled(self, paths = []):
return SideBarSelection(paths).len() > 0
+class SideBarGitDiffAllChangesSinceLastCommitIgnoreWhiteSpaceCommand(sublime_plugin.WindowCommand):
+ def run(self, paths = []):
+ for item in SideBarSelection(paths).getSelectedItems():
+ object = Object()
+ object.item = item
+ object.command = ['git', 'diff', 'HEAD', '--no-color', '-w', '--', item.forCwdSystemName()]
+ object.title = 'Diff: '+item.name()+'.diff'
+ object.no_results = 'No differences to show'
+ object.syntax_file = 'Packages/Diff/Diff.tmLanguage'
+ object.word_wrap = False
+ SideBarGit().run(object)
+ def is_enabled(self, paths = []):
+ return SideBarSelection(paths).len() > 0
+
class SideBarGitDiffChangesNotStagedCommand(sublime_plugin.WindowCommand):
def run(self, paths = []):
for item in SideBarSelection(paths).getSelectedItems():
Please sign in to comment.
Something went wrong with that request. Please try again.