audit the calls to invalidate-bitmap-cache in the framework and in

drracket and try to make them happen less often (or, if there will be
multiple ones, try to guarantee that there is an edit sequence)
This commit is contained in:
Robby Findler 2012-11-04 19:01:24 -06:00
parent 1126f02ddd
commit 81dc3bae37
3 changed files with 18 additions and 8 deletions

View File

@ -1315,7 +1315,8 @@
(inherit last-position find-first-snip get-top-level-window get-filename
get-tab get-canvas invalidate-bitmap-cache
set-position get-start-position get-end-position
highlight-range dc-location-to-editor-location)
highlight-range dc-location-to-editor-location
begin-edit-sequence end-edit-sequence)
(define compilation-out-of-date? #f)
@ -1507,6 +1508,7 @@
(reset-frame-expand-error #f))
(define/private (show-error-in-margin res)
(begin-edit-sequence #f #f)
(define tlw (send (get-tab) get-frame))
(send (get-tab) show-bkg-running 'nothing #f)
(set! error/status-message-str (vector-ref res 1))
@ -1521,7 +1523,8 @@
(set-error-ranges-from-online-error-ranges (vector-ref res 2))
(invalidate-online-error-ranges)
(set! error/status-message-hidden? #f)
(update-frame-expand-error))
(update-frame-expand-error)
(end-edit-sequence))
(define/private (show-error-as-highlighted-regions res)
(define tlw (send (get-tab) get-frame))
@ -1556,6 +1559,7 @@
(send (send (get-tab) get-ints) set-error-ranges srclocs))
(define/private (clear-old-error)
(begin-edit-sequence #f #f)
(for ([cleanup-thunk (in-list online-highlighted-errors)])
(cleanup-thunk))
(for ([an-error-range (in-list online-error-ranges)])
@ -1563,7 +1567,8 @@
((error-range-clear-highlight an-error-range))
(set-error-range-clear-highlight! an-error-range #f)))
(invalidate-online-error-ranges)
(set-online-error-ranges '()))
(set-online-error-ranges '())
(end-edit-sequence))
(define/private (invalidate-online-error-ranges)
(when (get-admin)
@ -1814,7 +1819,8 @@
(update-recently-typed #t)
(set! fade-amount 0)
(send recently-typed-timer stop)
(send recently-typed-timer start 10000 #t))
(when lang-wants-big-defs/ints-labels?
(send recently-typed-timer start 10000 #t)))
(super on-char evt))
(define/private (update-recently-typed nv)
@ -1829,7 +1835,8 @@
[else (preferences:get 'drracket:defs/ints-labels)]))
(unless (equal? new-inside? inside?)
(set! inside? new-inside?)
(invalidate-bitmap-cache 0 0 'display-end 'display-end))
(when lang-wants-big-defs/ints-labels?
(invalidate-bitmap-cache 0 0 'display-end 'display-end)))
(cond
[(and lang-wants-big-defs/ints-labels?
(preferences:get 'drracket:defs/ints-labels)

View File

@ -434,7 +434,6 @@ TODO
insert
insert-before
insert-between
invalidate-bitmap-cache
is-locked?
last-position
line-location

View File

@ -3855,7 +3855,9 @@ designates the character that triggers autocompletion
;; draws line numbers on the left hand side of a text% object
(define line-numbers-mixin
(mixin ((class->interface text%) editor:standard-style-list<%>) (line-numbers<%>)
(inherit get-visible-line-range
(inherit begin-edit-sequence
end-edit-sequence
get-visible-line-range
get-visible-position-range
last-line
line-location
@ -4194,6 +4196,7 @@ designates the character that triggers autocompletion
(when (showing-line-numbers?)
(define dc (get-dc))
(when dc
(begin-edit-sequence #f #f)
(define bx (box 0))
(define by (box 0))
(define tw (text-width dc (number-space+1)))
@ -4209,7 +4212,8 @@ designates the character that triggers autocompletion
tw
th)
(unless (= line (last-line))
(loop (+ line 1))))))))
(loop (+ line 1)))))
(end-edit-sequence))))
(super-new)
(setup-padding)))