more search fixes

This commit is contained in:
Robby Findler 2016-07-26 19:15:33 -05:00
parent 4053cb1e16
commit fcd134eebe
2 changed files with 14 additions and 14 deletions

View File

@ -1275,9 +1275,9 @@
(unless (and to-replace-highlight (unless (and to-replace-highlight
(= (car to-replace-highlight) next) (= (car to-replace-highlight) next)
(= (cdr to-replace-highlight) (= (cdr to-replace-highlight)
(+ next (string-length searching-str)))) (string-length searching-str)))
(replace-highlight->normal-hit) (replace-highlight->normal-hit)
(define pr (cons next (+ next (string-length searching-str)))) (define pr (cons next (string-length searching-str)))
(unhighlight-hit pr) (unhighlight-hit pr)
(highlight-replace pr))] (highlight-replace pr))]
[else [else

View File

@ -67,35 +67,35 @@
(send t set-searching-state "aba" #t #f) (send t set-searching-state "aba" #t #f)
(send t set-position 0 0))) (send t set-position 0 0)))
`(((0 . 3) normal-search-color) `(((0 . 3) normal-search-color)
((4 . 7) normal-search-color))) ((4 . 3) normal-search-color)))
(test-search (list '(begin (send t insert "aba aba") (test-search (list '(begin (send t insert "aba aba")
(send t set-searching-state "aba" #t #f)) (send t set-searching-state "aba" #t #f))
'(send t set-position 0 0)) '(send t set-position 0 0))
`(((0 . 3) normal-search-color) `(((0 . 3) normal-search-color)
((4 . 7) normal-search-color))) ((4 . 3) normal-search-color)))
(test-search (list '(begin (send t insert "abaaba") (test-search (list '(begin (send t insert "abaaba")
(send t set-searching-state "aba" #t #f) (send t set-searching-state "aba" #t #f)
(send t set-position 0 0))) (send t set-position 0 0)))
`(((0 . 3) normal-search-color) `(((0 . 3) normal-search-color)
((3 . 6) normal-search-color))) ((3 . 3) normal-search-color)))
(test-search (list '(begin (send t insert "abaaba") (test-search (list '(begin (send t insert "abaaba")
(send t set-searching-state "aba" #t #f)) (send t set-searching-state "aba" #t #f))
'(send t set-position 0 0)) '(send t set-position 0 0))
`(((0 . 3) normal-search-color) `(((0 . 3) normal-search-color)
((3 . 6) normal-search-color))) ((3 . 3) normal-search-color)))
(test-search (list '(begin (send t insert "abababa") (test-search (list '(begin (send t insert "abababa")
(send t set-searching-state "aba" #t #f) (send t set-searching-state "aba" #t #f)
(send t set-position 0 0))) (send t set-position 0 0)))
`(((0 . 3) normal-search-color) `(((0 . 3) normal-search-color)
((4 . 7) normal-search-color))) ((4 . 3) normal-search-color)))
(test-search (list '(begin (send t insert "abababa") (test-search (list '(begin (send t insert "abababa")
(send t set-searching-state "aba" #t #f)) (send t set-searching-state "aba" #t #f))
'(send t set-position 0 0)) '(send t set-position 0 0))
`(((0 . 3) normal-search-color) `(((0 . 3) normal-search-color)
((4 . 7) normal-search-color))) ((4 . 3) normal-search-color)))
(test-search (list '(begin (send t insert "Aba") (test-search (list '(begin (send t insert "Aba")
(send t set-searching-state "aba" #t #f) (send t set-searching-state "aba" #t #f)
@ -131,25 +131,25 @@
(send t set-searching-state "aba" #f #t) (send t set-searching-state "aba" #f #t)
(send t set-position 0 0))) (send t set-position 0 0)))
`(((0 . 3) dark-search-color) `(((0 . 3) dark-search-color)
((4 . 7) light-search-color))) ((4 . 3) light-search-color)))
(test-search (list '(begin (send t insert "abababa") (test-search (list '(begin (send t insert "abababa")
(send t set-searching-state "aba" #f #t)) (send t set-searching-state "aba" #f #t))
'(send t set-position 0 0)) '(send t set-position 0 0))
`(((0 . 3) dark-search-color) `(((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") (test-search (list '(begin (send t insert "aba aba aba")
(send t set-searching-state "aba" #f #t) (send t set-searching-state "aba" #f #t)
(send t set-position 1 1))) (send t set-position 1 1)))
`(((0 . 3) light-search-color) `(((0 . 3) light-search-color)
((4 . 7) dark-search-color) ((4 . 3) dark-search-color)
((8 . 11) light-search-color))) ((8 . 3) light-search-color)))
(test-search (list '(begin (send t insert "aba aba aba") (test-search (list '(begin (send t insert "aba aba aba")
(send t set-searching-state "aba" #f #t)) (send t set-searching-state "aba" #f #t))
'(send t set-position 1 1)) '(send t set-position 1 1))
`(((0 . 3) light-search-color) `(((0 . 3) light-search-color)
((4 . 7) dark-search-color) ((4 . 3) dark-search-color)
((8 . 11) light-search-color))) ((8 . 3) light-search-color)))
(test-search (list '(begin (send t insert "aba") (test-search (list '(begin (send t insert "aba")
(send t set-searching-state "aba" #f #t)) (send t set-searching-state "aba" #f #t))