move to drracket:keystrokes and away from surrogate stuff
This commit is contained in:
parent
b8cb62ce42
commit
fb6a9116a7
|
@ -5,24 +5,12 @@
|
||||||
string-constants
|
string-constants
|
||||||
framework)
|
framework)
|
||||||
|
|
||||||
(provide determine-spaces paragraph-indentation surrogate%)
|
(provide determine-spaces paragraph-indentation keystrokes)
|
||||||
|
|
||||||
(define paragraph-width-pref-name 'scribble-reindent-paragraph-width)
|
(define paragraph-width-pref-name 'scribble-reindent-paragraph-width)
|
||||||
(define paragraph-width-good-val? (and/c exact-nonnegative-integer? (>=/c 10)))
|
(define paragraph-width-good-val? (and/c exact-nonnegative-integer? (>=/c 10)))
|
||||||
(preferences:set-default paragraph-width-pref-name 60 paragraph-width-good-val?)
|
(preferences:set-default paragraph-width-pref-name 60 paragraph-width-good-val?)
|
||||||
|
|
||||||
(define surrogate%
|
|
||||||
(class (racket:text-mode-mixin
|
|
||||||
(color:text-mode-mixin
|
|
||||||
mode:surrogate-text%))
|
|
||||||
(define/override (on-enable-surrogate txt)
|
|
||||||
(send (send txt get-keymap) chain-to-keymap at-exp-keymap #f)
|
|
||||||
(super on-enable-surrogate txt))
|
|
||||||
(define/override (on-disable-surrogate txt)
|
|
||||||
(keymap:remove-chained-keymap txt at-exp-keymap)
|
|
||||||
(super on-disable-surrogate txt))
|
|
||||||
(super-new)))
|
|
||||||
|
|
||||||
(preferences:add-to-editor-checkbox-panel
|
(preferences:add-to-editor-checkbox-panel
|
||||||
(λ (editor-panel)
|
(λ (editor-panel)
|
||||||
(define hp (new horizontal-panel% [parent editor-panel] [stretchable-height #f]))
|
(define hp (new horizontal-panel% [parent editor-panel] [stretchable-height #f]))
|
||||||
|
@ -50,7 +38,6 @@
|
||||||
(preferences:set paragraph-width-pref-name candidate-num)))
|
(preferences:set paragraph-width-pref-name candidate-num)))
|
||||||
(update-tf-bkg)))
|
(update-tf-bkg)))
|
||||||
|
|
||||||
(define at-exp-keymap (new keymap:aug-keymap%))
|
|
||||||
(define (reindent-paragraph t evt)
|
(define (reindent-paragraph t evt)
|
||||||
(unless (send t is-stopped?)
|
(unless (send t is-stopped?)
|
||||||
(define sp (send t get-start-position))
|
(define sp (send t get-start-position))
|
||||||
|
@ -59,11 +46,12 @@
|
||||||
t sp
|
t sp
|
||||||
(preferences:get paragraph-width-pref-name)))))
|
(preferences:get paragraph-width-pref-name)))))
|
||||||
|
|
||||||
(send at-exp-keymap add-function "reindent-paragraph" reindent-paragraph)
|
(define keystrokes
|
||||||
(send at-exp-keymap map-function "esc;q" "reindent-paragraph")
|
(append (list (list "esc;q" reindent-paragraph)
|
||||||
(send at-exp-keymap map-function "?:a:q" "reindent-paragraph")
|
(list "?:a:q" reindent-paragraph))
|
||||||
(when (equal? (system-type) 'unix)
|
(if (equal? (system-type) 'unix)
|
||||||
(send at-exp-keymap map-function "m:q" "reindent-paragraph"))
|
(list (list "m:q" reindent-paragraph))
|
||||||
|
(list))))
|
||||||
|
|
||||||
;;(paragraph-indentation a-racket:text posi width) → void?
|
;;(paragraph-indentation a-racket:text posi width) → void?
|
||||||
;; pos : exact-integer? = current given position
|
;; pos : exact-integer? = current given position
|
||||||
|
|
Loading…
Reference in New Issue
Block a user