From e429be1d5538cb81f9bfae5be0a3c6c0655f5fd0 Mon Sep 17 00:00:00 2001 From: Ches Martin Date: Mon, 26 Sep 2016 22:55:58 +0700 Subject: [PATCH] Fix a bug in non-Syntastic typecheck error highlighting Regression from #328 where Vim's string result to the Syntastic feature detection wasn't properly cast to Boolean, and escaping was doubled after changing match pattern to a Python raw string. Closes #339. --- ensime_shared/editor.py | 4 ++-- ensime_shared/typecheck.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ensime_shared/editor.py b/ensime_shared/editor.py index 4709379..b5aab91 100644 --- a/ensime_shared/editor.py +++ b/ensime_shared/editor.py @@ -357,7 +357,7 @@ def display_notes(self, notes): """Renders "notes" reported by ENSIME, such as typecheck errors.""" # TODO: this can probably be a cached property like isneovim - hassyntastic = bool(self._vim.eval('exists(":SyntasticCheck")')) + hassyntastic = bool(int(self._vim.eval('exists(":SyntasticCheck")'))) if hassyntastic: self.__display_notes_with_syntastic(notes) @@ -395,7 +395,7 @@ def is_note_correct(note): # Server bug? See #200 def __display_notes(self, notes): current_file = self.path() - highlight_cmd = r"matchadd('EnErrorStyle', '\\%{}l\\%>{}c\\%<{}c')" + highlight_cmd = r"matchadd('EnErrorStyle', '\%{}l\%>{}c\%<{}c')" for note in notes: l = note['line'] diff --git a/ensime_shared/typecheck.py b/ensime_shared/typecheck.py index ee20623..6f8394f 100644 --- a/ensime_shared/typecheck.py +++ b/ensime_shared/typecheck.py @@ -25,7 +25,9 @@ def handle_typecheck_complete(self, call_id, payload): Calls editor to display/highlight line notes and clears notes buffer. """ + self.log.debug('handle_typecheck_complete: in') if not self.currently_buffering_typechecks: + self.log.debug('Completed typecheck was not requested by user, not displaying notes') return self.editor.display_notes(self.buffered_notes)