From 20cf44f4954b0e73f84d7f0787aae3d3ffdd6dc9 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Sun, 21 Apr 2024 07:11:10 +0800 Subject: [PATCH] refactor: tidy codes Signed-off-by: Jack Cherng --- plugin/commands/auto_set_syntax.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/commands/auto_set_syntax.py b/plugin/commands/auto_set_syntax.py index 45dd3bda..79c8ba8e 100644 --- a/plugin/commands/auto_set_syntax.py +++ b/plugin/commands/auto_set_syntax.py @@ -51,7 +51,7 @@ def run_auto_set_syntax_on_view( if event is ListenerEvent.EXEC: return _assign_syntax_for_exec_output(view_snapshot, event) - # prerequsites + # prerequisites if not ( (window := view.window()) and is_syntaxable_view(view, must_plaintext=must_plaintext) @@ -84,10 +84,11 @@ def run_auto_set_syntax_on_view( ListenerEvent.COMMAND, ListenerEvent.INIT, ListenerEvent.LOAD, - ListenerEvent.MODIFY, - ListenerEvent.PASTE, ListenerEvent.SAVE, ListenerEvent.UNTRANSIENTIZE, + # modify + ListenerEvent.MODIFY, + ListenerEvent.PASTE, } and _assign_syntax_with_magika(view_snapshot, event): return True