From 30832594fb59eb05c9bd5634d83ab5a9a766f724 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Sat, 2 Mar 2024 16:28:16 +0800 Subject: [PATCH] fix: exception related to "None" when triggered frequently Related to multithread timer... Signed-off-by: Jack Cherng --- plugin/commands/auto_set_syntax.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/commands/auto_set_syntax.py b/plugin/commands/auto_set_syntax.py index 518aa1ff..82fdb46c 100644 --- a/plugin/commands/auto_set_syntax.py +++ b/plugin/commands/auto_set_syntax.py @@ -61,6 +61,10 @@ def run_auto_set_syntax_on_view( *, must_plaintext: bool = False, ) -> bool: + # multithread guard... + if not G.view_snapshot_collection.get_by_view(view): + return False + if event is ListenerEvent.EXEC: return _assign_syntax_for_exec_output(view, event)