Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

refresh annotations after every command #161

Open
wants to merge 1 commit into from

2 participants

@sheldon
Collaborator

This isn't working yet, but I've hit a bit of a brick wall. I would love some help on what I'm doing wrong. Trying to solve #100.

@bordaigorl

Easiest fix: set may_change_files = True for commands that need to refresh annotations.
This causes the file to be reloaded and as a consequence the event listener for annotations catches the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 14, 2012
  1. @sheldon
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 git.py
View
9 git.py
@@ -152,6 +152,11 @@ def run_command(self, command, callback=None, show_status=True,
if not callback:
callback = self.generic_done
+ if not isinstance(self, GitAnnotateCommand):
+ for view in self.get_window().views():
+ if view.settings().get('live_git_annotations'):
+ view.run_command('git_annotate', {"reset":True})
+
thread = CommandThread(command, callback, **kwargs)
thread.start()
@@ -958,9 +963,9 @@ class GitAnnotateCommand(GitTextCommand):
# current state of the HEAD is being pulled from git.
# 2. All consecutive runs will pass the current buffer into diffs stdin. The resulting
# output is then parsed and regions are set accordingly.
- def run(self, view):
+ def run(self, view, reset=None):
# If the annotations are already running, we dont have to create a new tmpfile
- if hasattr(self, "tmp"):
+ if hasattr(self, "tmp") and not reset:
self.compare_tmp(None)
return
self.tmp = tempfile.NamedTemporaryFile()
Something went wrong with that request. Please try again.