Skip to content

Update blame view upon save #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 6, 2014
Merged

Conversation

dmnd
Copy link
Contributor

@dmnd dmnd commented Aug 30, 2014

Fixes #29.

Test plan:

First test editing when view is open:

  • Open blame
  • Add some newlines
  • Save file
  • See blame view update

Now test it updates upon second display:

  • Open blame
  • Close blame
  • Add some newlines
  • Save file
  • Open blame again
  • See it update

Fixes alexcorre#29.

Test plan:

First test editing when view is open:

	* Open blame
	* Add some newlines
	* Save file
	* See blame view update

Now test it updates upon second display:

	* Open blame
	* Close blame
	* Add some newlines
	* Save file
	* Open blame again
	* See it update
@alexcorre
Copy link
Owner

This isnt working for me. Pulled down your branch on my machine and am testing it out. It appears we are indeed calling setState with the new blame data on a save but the blame UI is not updating. Even after closing and opening.

Running atom 0.124.0

@dmnd
Copy link
Contributor Author

dmnd commented Sep 2, 2014

Weird, let me test it out again.

dmnd added 2 commits September 1, 2014 23:02
In the last commit I think I simplified the code and tricked myself into
thinking I tested it, but I must have not reloaded the package. This commit
works though.

Test plan:

First test editing when view is open:

 * Open blame
 * Add some newlines
 * Save file
 * See blame view update

Now test it updates upon second display:

 * Open blame
 * Close blame
 * Add some newlines
 * Save file
 * Open blame again
 * See it update
@dmnd
Copy link
Contributor Author

dmnd commented Sep 2, 2014

Ok, fixed it. Sorry about that. I think I tested it before doing a cleanup pass. My cleanup broke it, but somehow I didn't test again before opening the PR. Maybe I forgot to reload the Atom window or something.

While doing this I also noticed a bug in #32 which I have fixed here... I guess the night I opened those PRs wasn't a good one for coding.

Not sure what happened when I tried to do this in 39133b1, but evaluating
`DEFAULT_DATE` at import time doesn't work because `atom.config.get` returns
undefined. So calculate it later and cache it.

Test Plan:
Reloaded window then opened blame in a big file. Saw my preferred datestring
and not the full ISO 8601 format.
@dmnd
Copy link
Contributor Author

dmnd commented Sep 2, 2014

BTW, this PR is a pretty heavyweight way to update the blame view. It calls blame again on the entire file so it can be slow on large files with complex histories.

We could definitely make this faster if we stored the blame data for the unmodified file, then incrementally updated it based on the changes that have been made to the file. I decided that this was good enough for now though.

alexcorre added a commit that referenced this pull request Sep 6, 2014
@alexcorre alexcorre merged commit 09047d2 into alexcorre:master Sep 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

blame doesnt update on second open after edit
2 participants