adjust line number mixin so it postpones recomputation of
sizes until the end of an edit sequence (when appropriate)
This commit is contained in:
parent
5a9c5f681b
commit
a504f77d54
|
@ -3882,6 +3882,7 @@ designates the character that triggers autocompletion
|
||||||
(mixin ((class->interface text%) editor:standard-style-list<%>) (line-numbers<%>)
|
(mixin ((class->interface text%) editor:standard-style-list<%>) (line-numbers<%>)
|
||||||
(inherit begin-edit-sequence
|
(inherit begin-edit-sequence
|
||||||
end-edit-sequence
|
end-edit-sequence
|
||||||
|
in-edit-sequence?
|
||||||
get-visible-line-range
|
get-visible-line-range
|
||||||
get-visible-position-range
|
get-visible-position-range
|
||||||
last-line
|
last-line
|
||||||
|
@ -3907,6 +3908,8 @@ designates the character that triggers autocompletion
|
||||||
;; only two values should be 'left or 'right
|
;; only two values should be 'left or 'right
|
||||||
(init-field [alignment 'right])
|
(init-field [alignment 'right])
|
||||||
|
|
||||||
|
(define need-to-setup-padding? #f)
|
||||||
|
|
||||||
(define/private (number-space)
|
(define/private (number-space)
|
||||||
(number->string (max (* 10 (add1 (last-line))) 100)))
|
(number->string (max (* 10 (add1 (last-line))) 100)))
|
||||||
;; add an extra 0 so it looks nice
|
;; add an extra 0 so it looks nice
|
||||||
|
@ -4064,12 +4067,22 @@ designates the character that triggers autocompletion
|
||||||
(define/augment (after-insert start length)
|
(define/augment (after-insert start length)
|
||||||
(inner (void) after-insert start length)
|
(inner (void) after-insert start length)
|
||||||
; in case the max line number changed:
|
; in case the max line number changed:
|
||||||
(setup-padding))
|
(if (in-edit-sequence?)
|
||||||
|
(set! need-to-setup-padding? #t)
|
||||||
|
(setup-padding)))
|
||||||
|
|
||||||
(define/augment (after-delete start length)
|
(define/augment (after-delete start length)
|
||||||
(inner (void) after-delete start length)
|
(inner (void) after-delete start length)
|
||||||
; in case the max line number changed:
|
; in case the max line number changed:
|
||||||
|
(if (in-edit-sequence?)
|
||||||
|
(set! need-to-setup-padding? #t)
|
||||||
|
(setup-padding)))
|
||||||
|
|
||||||
|
(define/augment (after-edit-sequence)
|
||||||
|
(when need-to-setup-padding?
|
||||||
|
(set! need-to-setup-padding? #f)
|
||||||
(setup-padding))
|
(setup-padding))
|
||||||
|
(inner (void) after-edit-sequence))
|
||||||
|
|
||||||
(define/private (draw-numbers dc top bottom dx dy start-line end-line)
|
(define/private (draw-numbers dc top bottom dx dy start-line end-line)
|
||||||
(define last-paragraph #f)
|
(define last-paragraph #f)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user