Skip to content

Commit

Permalink
chore: rename "special cases" to "heuristics"
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed Feb 15, 2024
1 parent c13e6e1 commit 56cd251
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/commands/auto_set_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 56cd251

Please sign in to comment.