From fe6c753960afbdaa1466c0b203a6c4ab48a88660 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 14 Nov 2019 16:21:39 -0800 Subject: [PATCH] Correctly fall back in the presence of an empty string. --- typescript/listeners/idle.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/typescript/listeners/idle.py b/typescript/listeners/idle.py index c3a66912..54c66d83 100644 --- a/typescript/listeners/idle.py +++ b/typescript/listeners/idle.py @@ -162,15 +162,16 @@ def show_errors(self, diagno_event_body, syntactic): sublime.DRAW_OUTLINED) else: settings = sublime.load_settings("TypeScript.sublime-settings") + error_color = settings.get("error_color") or "invalid.illegal" + error_icon = settings.get("error_icon") or "" + error_draw_style = \ + sublime.DRAW_OUTLINED if settings.get("error_outlined") \ + else sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SQUIGGLY_UNDERLINE view.add_regions(region_key, error_regions, - settings.get("error_color", "invalid.illegal"), - settings.get("error_icon", ""), - sublime.DRAW_OUTLINED - if settings.get("error_outlined") else - sublime.DRAW_NO_FILL + - sublime.DRAW_NO_OUTLINE + - sublime.DRAW_SQUIGGLY_UNDERLINE) + error_color, + error_icon, + error_draw_style) def update_status(self, view, info): """Update the status line with error info and quick info if no error info"""