Sublime Forum

Search string over project files

#1

I am trying to create a plugin that would search for currently opened file name over my project base. My current solution is that the file name will be copied to clipboard before the search panel will be opened.

Is there a way to pass my search string to find_in_files panel or call the search function somehow directly?

class SomeStuffFind(sublime_plugin.TextCommand):
  def run(self, edit, **args):
    self.args = args
    filename = self.view.window().active_view().file_name()
    filename = os.path.split(filename)[1]
    sublime.set_clipboard(filename)
    self.view.window().run_command('show_panel', {'panel': 'find_in_files'})
0 Likes

#2
0 Likes