fix the handling of the drracket:show-line-numbers? preference
so the line numbers change no matter who sets the preference
This commit is contained in:
parent
6b503fa947
commit
2c2669bfa6
|
@ -338,15 +338,7 @@
|
|||
(λ (editor-panel)
|
||||
(make-check-box 'drracket:show-line-numbers?
|
||||
(string-constant show-line-numbers)
|
||||
editor-panel
|
||||
(lambda (value)
|
||||
(define (drracket:frame? frame)
|
||||
(and (is-a? frame top-level-window<%>)
|
||||
(is-a? frame drracket:unit:frame%)))
|
||||
;; is it a hack to use `get-top-level-windows' ?
|
||||
(define frames (filter drracket:frame? (get-top-level-windows)))
|
||||
(when (not (null? frames))
|
||||
(send (car frames) show-line-numbers! value))))
|
||||
editor-panel)
|
||||
|
||||
;; come back to this one.
|
||||
#;
|
||||
|
|
|
@ -1422,7 +1422,19 @@ module browser threading seems wrong.
|
|||
(λ (l) (remq execute-warning-panel l)))
|
||||
(send execute-warning-canvas set-message #f))])))
|
||||
|
||||
(define/public (show-line-numbers! show)
|
||||
|
||||
;; bind the proc to a field
|
||||
;; so it stays alive as long
|
||||
;; as the frame stays alive
|
||||
(define show-line-numbers-pref-fn
|
||||
(let ([fn (lambda (pref value) (show-line-numbers! value))])
|
||||
(preferences:add-callback
|
||||
'drracket:show-line-numbers?
|
||||
fn
|
||||
#t)
|
||||
fn))
|
||||
|
||||
(define/private (show-line-numbers! show)
|
||||
(for ([tab tabs])
|
||||
(define text (send tab get-defs))
|
||||
(send text show-line-numbers! show))
|
||||
|
|
Loading…
Reference in New Issue
Block a user