MarkShark 27 Posted December 27, 2023 As of Delphi 11.2 they fixed the wholeword option handing (https://quality.embarcadero.com/browse/RSP-20731) however they changed the way that SelStart works when searching backwards (its' now -1 based instead of zero based..) To fix it to match the earlier behavior you have to do something like: if soDown in StringOptions then Result := SearchBuf(Buf, BufLen, SelStart, SelLength, SearchString, StringOptions) else Result := SearchBuf(Buf, BufLen, SelStart - 1, SelLength, SearchString, StringOptions); Basically, when searching backwards a SelStart of zero means to start the search at char position 1. Maybe there's some reason to make it work that way, but it's a change from earlier versions where searching forwards and backwards used the easier to understand base of zero as the start of the search. I haven't created a bug report for this as I had some problems with attempting to do it recently. Also is there a way to do an ifdef specific to 11.2? 1 Share this post Link to post
pyscripter 694 Posted December 27, 2023 35 minutes ago, MarkShark said: Also is there a way to do an ifdef specific to 11.2? See 1 Share this post Link to post
MarkShark 27 Posted December 27, 2023 Thanks! Is using Searchbuf (unfortunately with the $if to fix this issue) ok to use as a solution to the SynEdit search engine issue I've been working on? Otherwise, we'd need a reverse version of the current "Next" function which looks like it might be a Boyer-Moore implementation? Share this post Link to post
pyscripter 694 Posted December 27, 2023 57 minutes ago, MarkShark said: Thanks! Is using Searchbuf (unfortunately with the $if to fix this issue) ok to use as a solution to the SynEdit search engine issue I've been working on? Otherwise, we'd need a reverse version of the current "Next" function which looks like it might be a Boyer-Moore implementation? Please open an issue and describe the problem. Using SearchBuf should be OK. Share this post Link to post
MarkShark 27 Posted December 27, 2023 Issue #78 and my pull request to start to fix it is #79. I have it fixed and tested, just needed that last bit of info about the 11.2 problem. Works great in my testing so far. Share this post Link to post