Skip to content

Commit

Permalink
Merge 5a3a6f7 into e8c44a6
Browse files Browse the repository at this point in the history
  • Loading branch information
stoivo committed Jun 29, 2019
2 parents e8c44a6 + 5a3a6f7 commit 37f3ef2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions common/util/diff_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ def get_indices(chunks):


def get_changes(old, new):
# if one of the inputs, either old or new is more then 10 000 characters
# we skip tring to find the words which changed. If a hunk is more than
# 10 000 charachers it is most likly a generated change.
# We skip since this calculation take a lot of time then it gets bigger.
if max(len(old), len(new)) > 10000:
return []

old_chunks = tuple(filter(lambda x: x, boundary.split(old)))
new_chunks = tuple(filter(lambda x: x, boundary.split(new)))
old_indices = get_indices(old_chunks)
Expand Down
5 changes: 4 additions & 1 deletion core/commands/inline_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ class GsInlineDiffRefreshCommand(TextCommand, GitCommand):
are not supported in `cached` mode.
"""

def run(self, edit):
def run(self, **kwargs):
sublime.set_timeout_async(lambda: self.run_async(**kwargs), 0)

def run_async(self, edit):
file_path = self.file_path
in_cached_mode = self.view.settings().get("git_savvy.inline_diff_view.in_cached_mode")
ignore_eol_arg = (
Expand Down

0 comments on commit 37f3ef2

Please sign in to comment.