Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
two bugs together causes passing quick check
if patch is working
  • Loading branch information
jakkubu committed Apr 21, 2016
1 parent b5ceb21 commit 143a6f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ansi.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def detect_left_ansi(self, view):
sublime.set_timeout_async(partial(self.check_left_ansi, view), 50)

def check_left_ansi(self, view):
if self._is_view_valid(view):
if not self._is_view_valid(view):
self._del_event_listeners(view)
return
if view.settings().get("syntax") != "Packages/ANSIescape/ANSI.tmLanguage":
Expand All @@ -250,7 +250,7 @@ def check_left_ansi(self, view):
debug(view, "ANSI cmd done and no codes left")

def detect_syntax_change(self, view):
if self._is_view_valid(view):
if not self._is_view_valid(view):
self._del_event_listeners(view)
return
if view.settings().get("ansi_in_progres", False):
Expand All @@ -265,11 +265,11 @@ def detect_syntax_change(self, view):
view.window().run_command("undo_ansi")

def _is_view_valid(self, view):
if view.window is None:
if view.window() is None:
return False
if view.window not in sublime.windows():
if view.window() not in sublime.windows():
return False
if view not in view.window.views():
if view not in view.window().views():
return False
return True

Expand Down

0 comments on commit 143a6f8

Please sign in to comment.