audit drracket begin-edit-sequence calls

after this (and the previous) commit, shift-left and
shift-right seem to work properly again
This commit is contained in:
Robby Findler 2013-09-14 19:22:41 -05:00
parent 2b30be3265
commit 21e06eec53
5 changed files with 26 additions and 25 deletions

View File

@ -1336,7 +1336,7 @@ profile todo:
src src
(λ () (λ ()
(hash-set! edit-sequence-ht src #f) (hash-set! edit-sequence-ht src #f)
(send src begin-edit-sequence #f) (send src begin-edit-sequence #f #f)
(when (send src is-locked?) (when (send src is-locked?)
(hash-set! locked-ht src #t) (hash-set! locked-ht src #t)
(send src lock #f)))))) (send src lock #f))))))
@ -1394,7 +1394,7 @@ profile todo:
(hash-for-each (hash-for-each
edit-sequence-ht edit-sequence-ht
(λ (txt _) (λ (txt _)
(send txt begin-edit-sequence #f))) (send txt begin-edit-sequence #f #f)))
(hash-for-each (hash-for-each
edit-sequence-ht edit-sequence-ht
(λ (txt _) (λ (txt _)
@ -1889,7 +1889,7 @@ profile todo:
;; clear-profile-display : -> void ;; clear-profile-display : -> void
;; clears out the GUI showing the profile results ;; clears out the GUI showing the profile results
(define/public (clear-profile-display) (define/public (clear-profile-display)
(begin-edit-sequence) (begin-edit-sequence #t #f)
(let ([locked? (is-locked?)]) (let ([locked? (is-locked?)])
(lock #f) (lock #f)
(clear-old-results) (clear-old-results)
@ -1910,7 +1910,7 @@ profile todo:
;; does the work to erase any existing profile info ;; does the work to erase any existing profile info
;; and make new profiling info. ;; and make new profiling info.
(define/public (refresh-profile profile-info definitions-text) (define/public (refresh-profile profile-info definitions-text)
(begin-edit-sequence) (begin-edit-sequence #t #f)
(lock #f) (lock #f)
(erase) (erase)
(clear-old-results) (clear-old-results)
@ -1952,7 +1952,7 @@ profile todo:
(number? span)) (number? span))
(unless (hash-ref in-edit-sequence src (λ () #f)) (unless (hash-ref in-edit-sequence src (λ () #f))
(hash-set! in-edit-sequence src #t) (hash-set! in-edit-sequence src #t)
(send src begin-edit-sequence)) (send src begin-edit-sequence #t #f))
(let* ([color (get-color-value (let* ([color (get-color-value
(if (eq? (preferences:get 'drracket:profile-how-to-count) 'time) (if (eq? (preferences:get 'drracket:profile-how-to-count) 'time)
(prof-info-time info) (prof-info-time info)
@ -2058,7 +2058,7 @@ profile todo:
(λ () (λ ()
(hash-for-each (hash-for-each
in-edit-sequence in-edit-sequence
(λ (key val) (send key begin-edit-sequence))) (λ (key val) (send key begin-edit-sequence #t #f)))
(clear-highlight) (clear-highlight)
(hash-for-each (hash-for-each
in-edit-sequence in-edit-sequence

View File

@ -580,7 +580,8 @@ TODO
(define locs (or (get-error-ranges) '())) ;; calling set-error-range cleans up the locs (define locs (or (get-error-ranges) '())) ;; calling set-error-range cleans up the locs
(define error-arrows (and raw-error-arrows (cleanup-locs raw-error-arrows))) (define error-arrows (and raw-error-arrows (cleanup-locs raw-error-arrows)))
(for-each (λ (loc) (send (srcloc-source loc) begin-edit-sequence)) locs) (for ([loc (in-list locs)])
(send (srcloc-source loc) begin-edit-sequence #t #f))
(when color? (when color?
(let ([resets (let ([resets
@ -639,7 +640,7 @@ TODO
(when (and (is-a? source text%) (when (and (is-a? source text%)
(srcloc-position loc) (srcloc-position loc)
(srcloc-span loc)) (srcloc-span loc))
(send source begin-edit-sequence) (send source begin-edit-sequence #t #f)
(clear-error-highlighting) ;; clear the 'highlight-range' from previous errors (clear-error-highlighting) ;; clear the 'highlight-range' from previous errors

View File

@ -224,7 +224,7 @@
(define/public (get-show-docs?) (and the-strs (or locked? mouse-in-blue-box?))) (define/public (get-show-docs?) (and the-strs (or locked? mouse-in-blue-box?)))
(define/public (toggle-syncheck-docs) (define/public (toggle-syncheck-docs)
(begin-edit-sequence) (begin-edit-sequence #t #f)
(invalidate-blue-box-region) (invalidate-blue-box-region)
(cond (cond
[locked? [locked?
@ -240,7 +240,7 @@
(end-edit-sequence)) (end-edit-sequence))
(define/public (update-mouse-in-blue-box b) (define/public (update-mouse-in-blue-box b)
(unless (equal? b mouse-in-blue-box?) (unless (equal? b mouse-in-blue-box?)
(begin-edit-sequence) (begin-edit-sequence #t #f)
(invalidate-blue-box-region) (invalidate-blue-box-region)
(set! mouse-in-blue-box? b) (set! mouse-in-blue-box? b)
(invalidate-blue-box-region) (invalidate-blue-box-region)
@ -248,7 +248,7 @@
(define/public (update-locked b) (define/public (update-locked b)
(preferences:set 'drracket:syncheck:contracts-locked? b) (preferences:set 'drracket:syncheck:contracts-locked? b)
(unless (equal? b locked?) (unless (equal? b locked?)
(begin-edit-sequence) (begin-edit-sequence #t #f)
(invalidate-blue-box-region) (invalidate-blue-box-region)
(set! locked? b) (set! locked? b)
(invalidate-blue-box-region) (invalidate-blue-box-region)
@ -256,7 +256,7 @@
(define/public (update-mouse-in-lock-icon/read-more? lk? rm?) (define/public (update-mouse-in-lock-icon/read-more? lk? rm?)
(unless (and (equal? lk? mouse-in-lock-icon?) (unless (and (equal? lk? mouse-in-lock-icon?)
(equal? rm? mouse-in-read-more?)) (equal? rm? mouse-in-read-more?))
(begin-edit-sequence) (begin-edit-sequence #t #f)
(invalidate-blue-box-region) (invalidate-blue-box-region)
(set! mouse-in-lock-icon? lk?) (set! mouse-in-lock-icon? lk?)
(set! mouse-in-read-more? rm?) (set! mouse-in-read-more? rm?)
@ -426,7 +426,7 @@
(define/private (update-the-strs) (define/private (update-the-strs)
(update-the-strs/maybe-invalidate (update-the-strs/maybe-invalidate
(λ () (λ ()
(begin-edit-sequence) (begin-edit-sequence #t #f)
(invalidate-blue-box-region)) (invalidate-blue-box-region))
(λ () (λ ()
(when last-evt-seen (when last-evt-seen
@ -485,7 +485,7 @@
(< where the-strs-id-end)) (< where the-strs-id-end))
(and delete? (<= the-strs-id-start (+ where len) the-strs-id-end))) (and delete? (<= the-strs-id-start (+ where len) the-strs-id-end)))
(when the-strs (when the-strs
(begin-edit-sequence) (begin-edit-sequence #t #f)
(invalidate-blue-box-region) (invalidate-blue-box-region)
(set! the-strs #f) (set! the-strs #f)
(set! the-strs-id-start #f) (set! the-strs-id-start #f)

View File

@ -305,7 +305,7 @@ If the namespace does not, they are colored the unbound color.
(mixin ((class->interface text%)) (cs-clearing<%>) (mixin ((class->interface text%)) (cs-clearing<%>)
(inherit begin-edit-sequence end-edit-sequence) (inherit begin-edit-sequence end-edit-sequence)
(define/augment (on-delete start len) (define/augment (on-delete start len)
(begin-edit-sequence) (begin-edit-sequence #f #t)
(inner (void) on-delete start len)) (inner (void) on-delete start len))
(define/augment (after-delete start len) (define/augment (after-delete start len)
(inner (void) after-delete start len) (inner (void) after-delete start len)
@ -313,7 +313,7 @@ If the namespace does not, they are colored the unbound color.
(end-edit-sequence)) (end-edit-sequence))
(define/augment (on-insert start len) (define/augment (on-insert start len)
(begin-edit-sequence) (begin-edit-sequence #f #t)
(inner (void) on-insert start len)) (inner (void) on-insert start len))
(define/augment (after-insert start len) (define/augment (after-insert start len)
(inner (void) after-insert start len) (inner (void) after-insert start len)
@ -1728,7 +1728,7 @@ If the namespace does not, they are colored the unbound color.
(let ([definitions (get-defs)]) (let ([definitions (get-defs)])
(when (send definitions syncheck:arrows-visible?) (when (send definitions syncheck:arrows-visible?)
(let ([locked? (send definitions is-locked?)]) (let ([locked? (send definitions is-locked?)])
(send definitions begin-edit-sequence #f) (send definitions begin-edit-sequence #f #f)
(send definitions lock #f) (send definitions lock #f)
(send definitions syncheck:clear-arrows) (send definitions syncheck:clear-arrows)
(send definitions lock locked?) (send definitions lock locked?)
@ -2179,7 +2179,7 @@ If the namespace does not, they are colored the unbound color.
;; so that edits to the definitions text work out. ;; so that edits to the definitions text work out.
(define/private (with-lock/edit-sequence definitions-text thnk) (define/private (with-lock/edit-sequence definitions-text thnk)
(let* ([locked? (send definitions-text is-locked?)]) (let* ([locked? (send definitions-text is-locked?)])
(send definitions-text begin-edit-sequence) (send definitions-text begin-edit-sequence #t #f)
(send definitions-text lock #f) (send definitions-text lock #f)
(thnk) (thnk)
(send definitions-text end-edit-sequence) (send definitions-text end-edit-sequence)

View File

@ -607,7 +607,7 @@
;; the reader-module method's result is used a test of whether or ;; the reader-module method's result is used a test of whether or
;; not the get-metadata method is used for this language ;; not the get-metadata method is used for this language
(let ([metadata (send lang get-metadata (filename->modname filename) settings)]) (let ([metadata (send lang get-metadata (filename->modname filename) settings)])
(begin-edit-sequence #f) (begin-edit-sequence #f #f)
(begin-metadata-changes) (begin-metadata-changes)
(let ([locked? (is-locked?)]) (let ([locked? (is-locked?)])
(when locked? (lock #f)) (when locked? (lock #f))
@ -648,7 +648,7 @@
(define/augment (on-load-file filename format) (define/augment (on-load-file filename format)
(inner (void) on-load-file filename format) (inner (void) on-load-file filename format)
(begin-edit-sequence #f)) (begin-edit-sequence #f #f))
(define/augment (after-load-file success?) (define/augment (after-load-file success?)
(when success? (when success?
(let-values ([(module-language module-language-settings) (let-values ([(module-language module-language-settings)
@ -902,7 +902,7 @@
next-settings)))) next-settings))))
(when auto-text (when auto-text
(set! ignore-edits? #t) (set! ignore-edits? #t)
(begin-edit-sequence #f) (begin-edit-sequence #f #f)
(insert auto-text) (insert auto-text)
(set-modified #f) (set-modified #f)
(set! ignore-edits? #f) (set! ignore-edits? #f)
@ -912,7 +912,7 @@
(when (and (not really-modified?) (when (and (not really-modified?)
(not (get-filename)) (not (get-filename))
(> (last-position) 0)) (> (last-position) 0))
(begin-edit-sequence #f) (begin-edit-sequence #f #f)
(send this erase) (send this erase)
(set-modified #f) (set-modified #f)
(end-edit-sequence) (end-edit-sequence)
@ -2394,7 +2394,7 @@
(cond (cond
[(and name (file-exists? name)) [(and name (file-exists? name))
(ensure-rep-hidden) (ensure-rep-hidden)
(send definitions-text begin-edit-sequence) (send definitions-text begin-edit-sequence #t #f)
(send definitions-text load-file/gui-error name) (send definitions-text load-file/gui-error name)
(send definitions-text end-edit-sequence) (send definitions-text end-edit-sequence)
(send language-message set-yellow #f)] (send language-message set-yellow #f)]
@ -3003,8 +3003,8 @@
(set! interactions-text (send current-tab get-ints)) (set! interactions-text (send current-tab get-ints))
(begin-container-sequence) (begin-container-sequence)
(send definitions-text begin-edit-sequence) (send definitions-text begin-edit-sequence #t #f)
(send interactions-text begin-edit-sequence) (send interactions-text begin-edit-sequence #t #f)
(for-each (λ (defs-canvas) (send defs-canvas set-editor definitions-text #f)) (for-each (λ (defs-canvas) (send defs-canvas set-editor definitions-text #f))
definitions-canvases) definitions-canvases)
(for-each (λ (ints-canvas) (send ints-canvas set-editor interactions-text #f)) (for-each (λ (ints-canvas) (send ints-canvas set-editor interactions-text #f))