racket/gui: correct undo array resize for Emacs-style undo

This commit is contained in:
Matthew Flatt 2014-01-28 02:45:51 -07:00
parent c8554e2489
commit ce63c5b75f

View File

@ -899,7 +899,10 @@
(size . < . max-undos) (size . < . max-undos)
emacs-style-undo?) emacs-style-undo?)
;; make more room ;; make more room
(let* ([s (min (* size 2) (if (eq? max-undos 'forever) (* size 2) max-undos))] (let* ([s (min (* size 2) (if (or (eq? max-undos 'forever)
emacs-style-undo?)
(* size 2)
max-undos))]
[naya (make-vector s #f)]) [naya (make-vector s #f)])
(for ([j (in-range size)]) (for ([j (in-range size)])
(vector-set! naya j (vector-ref c (modulo (+ start j) size)))) (vector-set! naya j (vector-ref c (modulo (+ start j) size))))