From 56cd2510dd6bcbff6ace49302bf85c6cc2a1d05e Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Thu, 15 Feb 2024 17:17:50 +0800 Subject: [PATCH] chore: rename "special cases" to "heuristics" Signed-off-by: Jack Cherng --- plugin/commands/auto_set_syntax.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/commands/auto_set_syntax.py b/plugin/commands/auto_set_syntax.py index b4185529..d039632f 100644 --- a/plugin/commands/auto_set_syntax.py +++ b/plugin/commands/auto_set_syntax.py @@ -194,7 +194,7 @@ def run_auto_set_syntax_on_view( } and _assign_syntax_with_trimmed_filename(view, event): return True - if _assign_syntax_with_special_cases(view, event): + if _assign_syntax_with_heuristics(view, event): return True if event in { @@ -342,7 +342,7 @@ def _assign_syntax_with_trimmed_filename(view: sublime.View, event: ListenerEven return False -def _assign_syntax_with_special_cases(view: sublime.View, event: ListenerEvent | None = None) -> bool: +def _assign_syntax_with_heuristics(view: sublime.View, event: ListenerEvent | None = None) -> bool: if not ( (view_snapshot := G.view_snapshot_collection.get_by_view(view)) and view_snapshot.syntax @@ -369,7 +369,7 @@ def is_json(view: sublime.View) -> bool: if is_large_file(view): if is_json(view) and (syntax := find_syntax_by_syntax_like("scope:source.json")): - return assign_syntax_to_view(view, syntax, details={"event": event, "reason": "special case"}) + return assign_syntax_to_view(view, syntax, details={"event": event, "reason": "heuristics"}) return False