Skip to content

Commit 2b6ba65

Browse files
committed
move 'options' to 'run_diff' method
1 parent b248644 commit 2b6ba65

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

file_diffs.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ def prep_content(self, ab, file_name, default_name):
7575
content = [line.replace("\r\n", "\n").replace("\r", "\n") for line in content]
7676
return (content, file_name)
7777

78-
def run_diff(self, a, b, from_file, to_file, external_diff_tool):
78+
def run_diff(self, a, b, from_file, to_file, **options):
79+
external_diff_tool = options.get('cmd')
80+
7981
(from_content, from_file) = self.prep_content(a, from_file, 'from_file')
8082
(to_content, to_file) = self.prep_content(b, to_file, 'to_file')
8183

@@ -156,7 +158,7 @@ def run(self, edit, **kwargs):
156158
self.run_diff(self.diff_content(), clipboard,
157159
from_file=self.view.file_name(),
158160
to_file='(clipboard)',
159-
external_diff_tool=kwargs.get('cmd', None))
161+
**kwargs)
160162

161163

162164
class FileDiffSelectionsCommand(FileDiffCommand):
@@ -199,15 +201,15 @@ def run(self, edit, **kwargs):
199201
self.run_diff(first_selection, second_selection,
200202
from_file='first selection',
201203
to_file='second selection',
202-
external_diff_tool=kwargs.get('cmd', None))
204+
**kwargs)
203205

204206

205207
class FileDiffSavedCommand(FileDiffCommand):
206208
def run(self, edit, **kwargs):
207209
self.run_diff(self.read_file(self.view.file_name()), self.diff_content(),
208210
from_file=self.view.file_name(),
209211
to_file=self.view.file_name() + u' (Unsaved)',
210-
external_diff_tool=kwargs.get('cmd', None))
212+
**kwargs)
211213

212214

213215
class FileDiffFileCommand(FileDiffCommand):
@@ -235,7 +237,7 @@ def on_done(index):
235237
self.run_diff(self.diff_content(), self.read_file(files[index]),
236238
from_file=self.view.file_name(),
237239
to_file=files[index],
238-
external_diff_tool=kwargs.get('cmd', None))
240+
**kwargs)
239241
sublime.set_timeout(lambda: self.view.window().show_quick_panel(file_picker, on_done), 1)
240242

241243
def find_files(self, folders):
@@ -287,7 +289,7 @@ def on_done(index):
287289
self.run_diff(self.diff_content(), contents[index],
288290
from_file=self.view.file_name(),
289291
to_file=files[index],
290-
external_diff_tool=kwargs.get('cmd', None))
292+
**kwargs)
291293

292294
if len(files) == 1:
293295
on_done(0)

0 commit comments

Comments
 (0)