-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Conversation
@@ -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") | |||
|
There was a problem hiding this comment.
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
sync
being the default you call it with sync=False
in on_activated and in the main gs_inline_diff command.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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()
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look now
adb66e7
to
77085d7
Compare
Otherwise refresh on the main thread to keep view and state in sync. Same as for the diff view.
77085d7
to
b9fcd15
Compare
LGTM! But I had to fix the commit message bc you got it backwards. |
Good, it was late last night. thanks |
@stoivo I cannot add commits to PR's. So this one works for me.