Skip to content
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

Stoivo/inline diff big files #1138

Merged
merged 5 commits into from
Sep 25, 2019
Merged

Conversation

kaste
Copy link
Collaborator

@kaste kaste commented Jul 5, 2019

@stoivo I cannot add commits to PR's. So this one works for me.

@@ -343,8 +340,7 @@ class GsInlineDiffFocusEventListener(EventListener):
latest file status when the view regains focus.
"""

def on_activated(self, view):

def on_activated_async(self, view):
if view.settings().get("git_savvy.inline_diff_view") is True:
view.run_command("gs_inline_diff_refresh")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a mistake. If you run a command like view.run_command("gs_inline_diff_refresh") it always starts at the main thread.

Look at how it is done for the diff view

https://github.com/divmain/GitSavvy/blob/29642a3f5731be4cbd63f9acd56b4b714fbc0001/core/commands/diff.py#L129-L138

sync being the default you call it with sync=False in on_activated and in the main gs_inline_diff command.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if there is a reliable way to add sleep to be blocking so I can check it works like I expect

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know what you're trying to do. time.sleep is always blocking. It is also important to check on which thread you run. (E.g. import threading; print threading.current_thread())

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look now

Otherwise refresh on the main thread to keep view and state in sync.
Same as for the diff view.
@kaste kaste force-pushed the stoivo/inline_diff_big_files branch from 77085d7 to b9fcd15 Compare September 25, 2019 11:06
@kaste
Copy link
Collaborator Author

kaste commented Sep 25, 2019

LGTM! But I had to fix the commit message bc you got it backwards.

@stoivo
Copy link
Member

stoivo commented Sep 25, 2019

Good, it was late last night. thanks

@stoivo stoivo merged commit b5f7776 into timbrel:dev Sep 25, 2019
@kaste kaste deleted the stoivo/inline_diff_big_files branch September 25, 2019 12:03
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.

None yet

2 participants