Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sublack/blacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ def run_black(self, command: list[str], env: dict[str, Any], cwd: str | None, co
self.log.debug("run_black: returncode %s, err: %s", process.returncode, err)
return process.returncode, out, err

def create_diff_view(self, edit: sublime.Edit, content: bytes, encoding: str):
def create_diff_view(self, content: bytes, encoding: str):
window = sublime.active_window()
view = window.new_file()
window.focus_view(view)
view.set_scratch(True)
view.set_name(f"sublack diff {self.view.name()}")
view.set_syntax_file("Packages/Diff/Diff.sublime-syntax")
view.insert(edit, 0, content.decode(encoding))
view.run_command('append', {'characters': content.decode(encoding)})

def get_working_directory(self):
filename = self.view.file_name()
Expand Down Expand Up @@ -290,7 +290,7 @@ def finalize(self, edit: sublime.Edit, extra, returncode, out, err, content, com

# diff mode
elif "--diff" in extra:
self.create_diff_view(edit, out, encoding)
self.create_diff_view(out, encoding)

# standard mode
else:
Expand Down