diff --git a/gui-lib/framework/private/text.rkt b/gui-lib/framework/private/text.rkt index 603fc33c..f1242f76 100644 --- a/gui-lib/framework/private/text.rkt +++ b/gui-lib/framework/private/text.rkt @@ -1275,9 +1275,9 @@ (unless (and to-replace-highlight (= (car to-replace-highlight) next) (= (cdr to-replace-highlight) - (+ next (string-length searching-str)))) + (string-length searching-str))) (replace-highlight->normal-hit) - (define pr (cons next (+ next (string-length searching-str)))) + (define pr (cons next (string-length searching-str))) (unhighlight-hit pr) (highlight-replace pr))] [else diff --git a/gui-test/framework/tests/search.rkt b/gui-test/framework/tests/search.rkt index 3b0fb20a..5da62c23 100644 --- a/gui-test/framework/tests/search.rkt +++ b/gui-test/framework/tests/search.rkt @@ -67,35 +67,35 @@ (send t set-searching-state "aba" #t #f) (send t set-position 0 0))) `(((0 . 3) normal-search-color) - ((4 . 7) normal-search-color))) + ((4 . 3) normal-search-color))) (test-search (list '(begin (send t insert "aba aba") (send t set-searching-state "aba" #t #f)) '(send t set-position 0 0)) `(((0 . 3) normal-search-color) - ((4 . 7) normal-search-color))) + ((4 . 3) normal-search-color))) (test-search (list '(begin (send t insert "abaaba") (send t set-searching-state "aba" #t #f) (send t set-position 0 0))) `(((0 . 3) normal-search-color) - ((3 . 6) normal-search-color))) + ((3 . 3) normal-search-color))) (test-search (list '(begin (send t insert "abaaba") (send t set-searching-state "aba" #t #f)) '(send t set-position 0 0)) `(((0 . 3) normal-search-color) - ((3 . 6) normal-search-color))) + ((3 . 3) normal-search-color))) (test-search (list '(begin (send t insert "abababa") (send t set-searching-state "aba" #t #f) (send t set-position 0 0))) `(((0 . 3) normal-search-color) - ((4 . 7) normal-search-color))) + ((4 . 3) normal-search-color))) (test-search (list '(begin (send t insert "abababa") (send t set-searching-state "aba" #t #f)) '(send t set-position 0 0)) `(((0 . 3) normal-search-color) - ((4 . 7) normal-search-color))) + ((4 . 3) normal-search-color))) (test-search (list '(begin (send t insert "Aba") (send t set-searching-state "aba" #t #f) @@ -131,25 +131,25 @@ (send t set-searching-state "aba" #f #t) (send t set-position 0 0))) `(((0 . 3) dark-search-color) - ((4 . 7) light-search-color))) + ((4 . 3) light-search-color))) (test-search (list '(begin (send t insert "abababa") (send t set-searching-state "aba" #f #t)) '(send t set-position 0 0)) `(((0 . 3) dark-search-color) - ((4 . 7) light-search-color))) + ((4 . 3) light-search-color))) (test-search (list '(begin (send t insert "aba aba aba") (send t set-searching-state "aba" #f #t) (send t set-position 1 1))) `(((0 . 3) light-search-color) - ((4 . 7) dark-search-color) - ((8 . 11) light-search-color))) + ((4 . 3) dark-search-color) + ((8 . 3) light-search-color))) (test-search (list '(begin (send t insert "aba aba aba") (send t set-searching-state "aba" #f #t)) '(send t set-position 1 1)) `(((0 . 3) light-search-color) - ((4 . 7) dark-search-color) - ((8 . 11) light-search-color))) + ((4 . 3) dark-search-color) + ((8 . 3) light-search-color))) (test-search (list '(begin (send t insert "aba") (send t set-searching-state "aba" #f #t))