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)