Do you have any code or ideas so far as to how you want to tackle this?
If you use view.sel()
you can determine the location that the cursor is at in the current file. view.find_all()
can take a regular expression and tell you all of the locations in the file where it matches.
Using those two endpoints you can find all of the matches and determine which ones are closest to the location the cursor is at to know which one is next or previous.
You can also modify the result of view.sel()
to change the cursor location; in doing so you can either jump the cursor to a specific point in the file or do that in addition to selecting text.
For this you want to create a TextCommand
and use it’s self.view
property to search in/manipulate the contents of whatever file is focused when you execute the command.