From 8060c21d2361711c02af9ca615baa5fa29c8408e Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Tue, 3 Dec 2013 20:28:41 +0100 Subject: [PATCH] Highlight the first file in overlay (fixes #1) --- GotoSelection.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GotoSelection.py b/GotoSelection.py index c498df6..2ffda59 100644 --- a/GotoSelection.py +++ b/GotoSelection.py @@ -53,5 +53,8 @@ def run(self): while (lineContents[0] in "# "): lineContents = lineContents[1:] - # Call the goto overlay, give it the current word or selection, and ask it to show files - self.window.run_command("show_overlay", {"overlay": "goto", "text": lineContents, "show_files": "true"}) + # Call the goto overlay, give it the current word or selection, and ask it to show files. + # We add a trailing character ('!') and then delete it in order to trigger "keyboard action" + # on the overlay and thus highlight the first file. + self.window.run_command("show_overlay", {"overlay": "goto", "text": lineContents + "!", "show_files": "true"}) + self.window.run_command("left_delete")