set the font before computing the distance between the line numbers and the real text. add an option to the general pane to enable line numbers

This commit is contained in:
Jon Rafkind 2010-11-01 23:45:00 -06:00
parent 18504774f0
commit eb89a429e7
2 changed files with 13 additions and 0 deletions

View File

@ -316,6 +316,18 @@
(make-check-box 'drracket:open-in-tabs
(string-constant open-files-in-tabs)
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))))
(make-check-box 'drracket:show-interactions-on-execute
(string-constant show-interactions-on-execute)
editor-panel)

View File

@ -3902,6 +3902,7 @@ designates the character that triggers autocompletion
(define-values (x y) (send dc get-origin))
(set! old-origin-x x)
(set! old-origin-y y)
(setup-dc dc)
(define-values (font-width font-height baseline space)
(send dc get-text-extent "10000"))
;; add an extra 0 so it looks nice