Skip to content

Commit

Permalink
Make ErrorMarker._highlighter lazy to avoid settings loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jarhart committed Aug 13, 2013
1 parent f901140 commit 05c3d4e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions errormarker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
class ErrorMarker(object):

def __init__(self, window, error_report, settings):
self._error_report = error_report
self._highlighter = CodeHighlighter(settings, self._current_error_in_view)
self._window = window
self._error_report = error_report
self.__settings = settings
self.__highlighter = None
settings.add_on_change(self.mark_errors)

@delayed(0)
Expand Down Expand Up @@ -70,3 +71,9 @@ def _line_errors(self, view):

def _current_error_in_view(self, view):
return self._error_report.current_error_in(view.file_name())

@property
def _highlighter(self):
if self.__highlighter is None:
self.__highlighter = CodeHighlighter(self.__settings, self._current_error_in_view)
return self.__highlighter

0 comments on commit 05c3d4e

Please sign in to comment.