I have a plugin I’m working on to trigger finding the current selection within all open files / project (Find in Files…).
Anyone know how I trigger this via a Sublime command? I’ve gotten as far as grabbing the selection, or if there is no selection the word the cursor is currently within.
import sublime, sublime_plugin
class QuickSearchCommand(sublime_plugin.TextCommand):
def run(self, edit):
for region in self.view.sel():
line = self.view.word(region)
if region.empty():
# search with self.view.substr(line) here
else:
# search with self.view.substr(region) here