Skip to content

Commit

Permalink
only show fmt error popup if it was a timeout, etc...
Browse files Browse the repository at this point in the history
  • Loading branch information
DisposaBoy committed Apr 20, 2016
1 parent 668409c commit 32a70c6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion gscommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,19 @@ def run(self, edit):

if err:
err = "Cannot fmt file. Error: `%s'" % err
short_err = '%s: %s... error logged to console' % (domain, err[:15])

def clear_status():
if self.view.get_status(domain) == short_err:
self.view.set_status(domain, '')

gs.println(domain, err)
self.view.show_popup("%s: <b>%s</b>" % (domain, err))
self.view.set_status(domain, short_err)
sublime.set_timeout(clear_status, 10000)

if 'ipc_timeout' in err:
self.view.show_popup("%s: <b>%s</b>" % (domain, err))

return

_, err = gspatch.merge(self.view, vsize, src, edit)
Expand Down

0 comments on commit 32a70c6

Please sign in to comment.