Skip to content

Commit

Permalink
Merge branch 'master' into randy3k/sha
Browse files Browse the repository at this point in the history
  • Loading branch information
randy3k committed May 5, 2017
2 parents f3723ce + 2938321 commit 3d6ec0c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion common/util/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pprint as _pprint

import sublime

from contextlib import contextmanager

_log = []
enabled = False
Expand All @@ -21,6 +21,16 @@ def stop_logging():
enabled = False


@contextmanager
def disable_logging():
global enabled
enabled = False
try:
yield
finally:
enabled = True


def get_log():
return json.dumps(_log, indent=2)

Expand Down
4 changes: 3 additions & 1 deletion core/commands/status_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from sublime_plugin import TextCommand, EventListener

from ..git_command import GitCommand
from ...common.util import debug


class GsStatusBarEventListener(EventListener):
Expand Down Expand Up @@ -57,7 +58,8 @@ def run_async(self):
self.view.erase_status("gitsavvy-repo-status")
return

short_status = self.get_branch_status_short()
with debug.disable_logging():
short_status = self.get_branch_status_short()
self.view.set_status("gitsavvy-repo-status", short_status)

global update_status_bar_soon
Expand Down

0 comments on commit 3d6ec0c

Please sign in to comment.