racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
449 stars 95 forks source link

Incorrect index when searching in DrRacket #304

Closed guojing0 closed 5 years ago

guojing0 commented 5 years ago

When I search for “module” from this program, the search bar at the end of DrRacket displays that there are 5 “module”s in the text, which is correct.

However, when first “module” is highlighted, search bar displays “0/5 match;” when the last “module” is highlighted, it displays “4/5 match.” If I click “Next,” the first “module” is again highlighted and “4/5” changes to “0/5.”

My DrRacket version is 7.4

jbclements commented 5 years ago

Yes, I believe that's the expected behavior. Okay if I close this?

guojing0 commented 5 years ago

Yes.

mflatt commented 5 years ago

Although I'm a fan of 0-based indexing, I'm surprised that counting from "0/5" to "4/5" is the expected behavior. Usually the "/" notation for "out of" goes with 1-based counting. Am I missing something?

rfindler commented 5 years ago

I see 1/5 in my version of DrRacket (as attached).

Screen Shot 2019-08-30 at 5 18 53 PM

guojing0 commented 5 years ago

Yes, I use the latest stable version.

Snip20190830_1 Snip20190830_2

mflatt commented 5 years ago

I see counting from "0/5" when I have "replace" visible, but I see counting from "1/5" when I hide "replace" and step to the next match.

rfindler commented 5 years ago

Ah, thanks!