sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

You can not search backwards with the API

Open FichteFoll opened this issue 11 years ago • 1 comments
trafficstars

The Find panel defines a "Find Prev" Button, but this is not reflected in the API. view.find(pattern, fromPosition, <flags>) does not provide a way to search backwards.

The only way to implement this now is by either substracting arbitrary numbers from fromPosition and trying as long as 0 is reached or a match before the initial fromPosition is found, or using view.find_all(pattern, <flags>, <format>, <extractions>) and then searching for the last find before fromPosition.

Initially brought up at http://www.sublimetext.com/forum/viewtopic.php?f=6&t=15300&p=57797#p57797.

FichteFoll avatar Feb 13 '14 01:02 FichteFoll

Dear developer, please add a flag that would denote the search direction to "view.find" (as suggested here): it is trivial to implement, and it is being expected for at least 10 years.

dymky avatar Jul 19 '20 23:07 dymky

Build 4149 adds FindFlags.WHOLEWORD, FindFlags.REVERSE and FindFlags.WRAP.

BenjaminSchaaf avatar May 04 '23 01:05 BenjaminSchaaf