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

Improvement: refresh status bar and related fix #659

Merged
merged 2 commits into from
May 29, 2017
Merged

Conversation

randy3k
Copy link
Collaborator

@randy3k randy3k commented May 28, 2017

Do not refresh status bar using GsInterfaceFocusEventListener, it is handled by GsStatusBarEventListener already.

@randy3k randy3k changed the title Improvement: refresh status bar less often Improvement: refresh status bar and related fix May 28, 2017
@@ -35,7 +35,7 @@ def run(self, edit):
global last_execution, update_status_bar_soon
if sublime.load_settings("GitSavvy.sublime-settings").get("git_status_in_status_bar"):

millisec = int(round(time.time() * 100))
millisec = int(round(time.time() * 1000))
# If we updated to less then 100 ms we don't need to update now but
Copy link
Member

Choose a reason for hiding this comment

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

Update the comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The comment is correct, the timeout is 100ms

Copy link
Member

Choose a reason for hiding this comment

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

Ahh, and time.time() returns seconds. Thanks

@stoivo
Copy link
Member

stoivo commented May 29, 2017

Are there any specific reasons why you add refresh_status_bar, just to reduce the calls?

@randy3k
Copy link
Collaborator Author

randy3k commented May 29, 2017

Both GsStatusBarEventListener and GsInterfaceFocusEventListener have a on_activated method to call gs_update_status_bar. This PR avoids duplicately calling to it.

@randy3k randy3k merged commit d9abb60 into master May 29, 2017
@randy3k randy3k deleted the randy3k/statusbar branch May 29, 2017 06:59
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.

2 participants