From 5cf050e93f140664164d3d59a95b0c9b523fa1c2 Mon Sep 17 00:00:00 2001 From: Ashwin Shenoy Date: Fri, 17 Sep 2021 15:38:33 +0530 Subject: [PATCH] Fix syntax test tab dialog appearing on navigating test files using `Goto Anything`. This commit fixes a situation where navigating syntax test files using `Goto Anything` can be disruptive. Since the view is loaded and PD throws the dialog for those files that use tabs in test files, this results in a bad UX. To prevent this, we simply skip files that are transiently loaded when navigating `Goto Anything`. --- plugins/syntaxtest_dev.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/syntaxtest_dev.py b/plugins/syntaxtest_dev.py index 176f3ccb..939f732e 100644 --- a/plugins/syntaxtest_dev.py +++ b/plugins/syntaxtest_dev.py @@ -431,6 +431,14 @@ def on_load(self, view): test_header = get_syntax_test_tokens(view) if not test_header: return + + # If the user navigates through syntax test files using Goto Anything, + # then the navigation is disrupted (because of the dialog) if the test + # files happens to use indentation. So, we just skip checking any files + # that are transiently opened by using Goto Anything. + if view.sheet().is_transient(): + return + current_syntax = view.settings().get('syntax', None) test_syntax = test_header.syntax_file