Skip to content

Commit def3c43

Browse files
committed
Adds overridable settings for error_color, quick_info_popup_max_width
1 parent bdb5863 commit def3c43

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

TypeScript.sublime-settings

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"auto_complete_triggers" : [ {"selector": "source.ts", "characters": "."} ],
33
"use_tab_stops": false,
4-
"word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?"
4+
"word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?",
5+
6+
// empty string, or one of "region.redish", "region.orangish", "region.yellowish", "region.greenish", "region.bluish", "region.purplish", "region.pinkish"
7+
"error_color": "",
8+
"quick_info_popup_max_width": 1024
59
}

typescript/commands/quick_info.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ def handle_quick_info(self, quick_info_resp_dict, display_point):
6666
self.template = Template(load_quickinfo_and_error_popup_template())
6767
text_parts = { "error": error_html, "info_str": escape_html(info_str), "doc_str": escape_html(doc_str) }
6868
html = self.template.substitute(text_parts)
69-
self.view.show_popup(html, flags=sublime.HIDE_ON_MOUSE_MOVE_AWAY, location=display_point, max_height=300, max_width=1024)
69+
70+
settings = sublime.load_settings("TypeScript.sublime-settings")
71+
self.view.show_popup(html, flags=sublime.HIDE_ON_MOUSE_MOVE_AWAY, location=display_point, max_height=300, max_width=settings.get("quick_info_popup_max_width") or 1024)
7072

7173
def get_error_text_html(self, pt):
7274
client_info = cli.get_or_add_file(self.view.file_name())

typescript/listeners/idle.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ def show_errors(self, diagno_event_body, syntactic):
161161
view.add_regions(region_key, error_regions, "invalid", "",
162162
sublime.DRAW_OUTLINED)
163163
else:
164-
view.add_regions(region_key, error_regions, "invalid.illegal", "",
164+
settings = sublime.load_settings("TypeScript.sublime-settings")
165+
view.add_regions(region_key, error_regions, settings.get("error_color") or "invalid.illegal", "",
165166
sublime.DRAW_NO_FILL +
166167
sublime.DRAW_NO_OUTLINE +
167168
sublime.DRAW_SQUIGGLY_UNDERLINE)

0 commit comments

Comments
 (0)