Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi 2010 Search Wrap Around

Is there any way to switch off the 'Wrapped around' functionality of Delphi 2010's search?

I understand lots of developers have issues with the new search function but it works well for me except when the search wraps around and goes to the first result again.

I also know that you can flag the Search selection box but this will not work for me. I miss the part of the search functionality that would let you search from cursor or scope and tell you when there are no more results.

An example of where this is messing me around. I have a tree view where lots of nodes are being accessed by level indexes (i.e. Item.Level = 1) and I need to add a new node at level 0 and thus all of the indexes needs to shift to Level + 1. I have wasted plenty of time now reassigning these indexes a second and even third time because the search function wraps (I cannot use the Replace for what I am doing).

It's a pain to watch the code scroll bar every time I change something and .Level = 0 has become .Level = 1, .Level = 2, etc.

like image 538
Renaldo Meere Avatar asked Feb 09 '11 08:02

Renaldo Meere


1 Answers

The default behavior in Delphi XE is a dialog box that asks to Restart search from the beginning of the file, including an (unchecked) checkbox to Wrap around without asking.

This behavior is configurable in Tools -> Options -> Editor Options -> Auto search wrap around.

I don't have Delphi 2010 running to verify but with any luck, this could be all it takes.

like image 89
Lieven Keersmaekers Avatar answered Oct 02 '22 11:10

Lieven Keersmaekers