From d00b1a3e7e77fd23cc8489bf6e0a6639497ab5b0 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Wed, 21 Feb 2024 22:22:31 +0800 Subject: [PATCH] refactor: tidy codes Signed-off-by: Jack Cherng --- plugin/commands/auto_set_syntax.py | 2 +- plugin/helpers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/commands/auto_set_syntax.py b/plugin/commands/auto_set_syntax.py index 065a8017..7138f3f8 100644 --- a/plugin/commands/auto_set_syntax.py +++ b/plugin/commands/auto_set_syntax.py @@ -67,7 +67,7 @@ def run_auto_set_syntax_on_view( # prerequsites if not ( (window := view.window()) - and is_syntaxable_view(view, must_plaintext) + and is_syntaxable_view(view, must_plaintext=must_plaintext) and (syntax_rule_collection := G.syntax_rule_collections.get(window)) ): return False diff --git a/plugin/helpers.py b/plugin/helpers.py index 09e8a281..838ab1c4 100644 --- a/plugin/helpers.py +++ b/plugin/helpers.py @@ -6,7 +6,7 @@ from .utils import is_plaintext_syntax, is_transient_view, stable_unique -def is_syntaxable_view(view: sublime.View, must_plaintext: bool = False) -> bool: +def is_syntaxable_view(view: sublime.View, *, must_plaintext: bool = False) -> bool: """Determinates whether the view is what we want to set a syntax on.""" return bool( view.is_valid()