Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add diff_new_window option #225

Closed
wants to merge 1 commit into from

2 participants

@suisho

I want diff window with other new window (I try difff_panel option, but that is too narrow).

@seanpoulter

This issue can be marked as closed since it's included and enabled in the settings:

{
...
    // use the panel for diff output, rather than a new scratch window (new tab)
    ,"diff_panel": false
...
}
@suisho

okay

@suisho suisho closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 1, 2013
  1. @suisho

    Add diff_new_window option

    suisho authored
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 2 deletions.
  1. +3 −0  Git.sublime-settings
  2. +2 −0  diff.py
  3. +6 −2 git.py
View
3  Git.sublime-settings
@@ -12,6 +12,9 @@
// use the panel for diff output, rather than a new scratch window (new tab)
,"diff_panel": false
+ // use the diff open new window
+ ,"diff_new_window": false
+
// affects blame command when no selection is made
// true: blame whole file
// false: blame only current line
View
2  diff.py
@@ -14,6 +14,8 @@ def diff_done(self, result):
s = sublime.load_settings("Git.sublime-settings")
if s.get('diff_panel'):
view = self.panel(result)
+ elif s.get('diff_new_window'):
+ view = self.scratch(result, title="Git Diff", new_window=True)
else:
view = self.scratch(result, title="Git Diff")
View
8 git.py
@@ -196,8 +196,12 @@ def _output_to_view(self, output_file, output, clear=False,
output_file.insert(edit, 0, output)
output_file.end_edit(edit)
- def scratch(self, output, title=False, position=None, **kwargs):
- scratch_file = self.get_window().new_file()
+ def scratch(self, output, title=False, position=None, new_window=False, **kwargs):
+ window = self.get_window()
+ if(new_window):
+ sublime.run_command("new_window")
+ window = sublime.active_window()
+ scratch_file = window.new_file()
if title:
scratch_file.set_name(title)
scratch_file.set_scratch(True)
Something went wrong with that request. Please try again.