Another idea would be to use javascript to pre-populate the search field with the current path, and then trigger a search command. Maybe something from this post (on a different topic) could be used to build such a command.
In there @ZenMoto folds the outline using a command. Maybe it could be adapted/changed into setting the content of the input search element, to something like: path: /my/current/file / /, and then open the search prompt?