fixed the extrememly-slow-pasting bug (that is only visible on slow machines, apparently)

svn: r15265

original commit: ee8cf97c6688ce6d156211a168f3936918b0d386
This commit is contained in:
Robby Findler 2009-06-25 14:43:24 +00:00
parent 97612d17df
commit afb87b48bd

View File

@ -877,7 +877,8 @@ WARNING: printf is rebound in the body of the unit to always
(split-snip (+ start len)) (split-snip (+ start len))
(let loop ([snip (find-snip start 'after-or-none)]) (let loop ([snip (find-snip start 'after-or-none)])
(when snip (when snip
(let ([next (send snip next)]) (let ([pos (get-snip-position snip)])
(when (< pos (+ start len))
(when (is-a? snip string-snip%) (when (is-a? snip string-snip%)
(let* ([old (send snip get-text 0 (send snip get-count))] (let* ([old (send snip get-text 0 (send snip get-count))]
[new (string-normalize old)]) [new (string-normalize old)])
@ -888,7 +889,7 @@ WARNING: printf is rebound in the body of the unit to always
(let ([snip-pos (get-snip-position snip)]) (let ([snip-pos (get-snip-position snip)])
(delete snip-pos (+ snip-pos (string-length old))) (delete snip-pos (+ snip-pos (string-length old)))
(insert new snip-pos snip-pos #f))))) (insert new snip-pos snip-pos #f)))))
(loop next))))) (loop (send snip next)))))))
(set! rewriting? #f))) (set! rewriting? #f)))
(end-edit-sequence) (end-edit-sequence)
(inner (void) after-insert start len)) (inner (void) after-insert start len))