Hi,
I use this code in sublime-text-2 to apply find-next operation to all cursors:
class MoveToNextCommand(sublime_plugin.TextCommand):
saved_pattern = ""
def run(self, edit):
# cb = sublime.get_clipboard()
def done(pattern):
self.saved_pattern = pattern
# we take end of selection for start point in search
cursor_points = [x.b for x in self.view.sel()]
# resulting_selection = []
e = self.view.begin_edit()
self.view.sel().clear()
for point in cursor_points:
region = self.view.find(pattern, point, sublime.LITERAL | sublime.IGNORECASE)
if region != None:
# resulting_selection.append(region)
self.view.sel().add(region)
self.view.end_edit(e)
sublime.active_window().show_input_panel("move cursors to next pattern: ", self.saved_pattern, done, None, None)
I would like to create similar command that will find in reverse instead forward from each cursor. How can i accomplish this?
There is no direction in self.view.find signature.
Thanks,
Alex