I'm writing a plugin to automatically search open files with the alt+clicked word.
- Code: Select all
import sublime, sublime_plugin
def run(self, edit):
for region in self.view.sel():
line = self.view.word(region)
self.view.insert(edit, line.begin(), self.view.substr(line))
self.view.insert(edit, region.begin(), self.view.substr(region))
This code grabs the word where the cursor was before the click, not the word you just clicked on. How would I move the cursor to the clicked word?