change the framework & drracket so that they still use the colorer
methods (paren matching, mostly) when the colorer is frozen (but continue to avoid using them when the colrer is stopped) closes PR 12374
This commit is contained in:
parent
f41fce1fc3
commit
e935b1fa8e
|
@ -436,7 +436,6 @@ TODO
|
||||||
insert-before
|
insert-before
|
||||||
insert-between
|
insert-between
|
||||||
invalidate-bitmap-cache
|
invalidate-bitmap-cache
|
||||||
is-frozen?
|
|
||||||
is-locked?
|
is-locked?
|
||||||
last-position
|
last-position
|
||||||
line-location
|
line-location
|
||||||
|
|
|
@ -204,8 +204,7 @@ module browser threading seems wrong.
|
||||||
(define (find-symbol text pos)
|
(define (find-symbol text pos)
|
||||||
(cond
|
(cond
|
||||||
[(and (is-a? text scheme:text<%>)
|
[(and (is-a? text scheme:text<%>)
|
||||||
(not (send text is-stopped?))
|
(not (send text is-stopped?)))
|
||||||
(not (send text is-frozen?)))
|
|
||||||
(let* ([before (send text get-backward-sexp pos)]
|
(let* ([before (send text get-backward-sexp pos)]
|
||||||
[before+ (and before (send text get-forward-sexp before))]
|
[before+ (and before (send text get-forward-sexp before))]
|
||||||
[after (send text get-forward-sexp pos)]
|
[after (send text get-forward-sexp pos)]
|
||||||
|
|
|
@ -169,7 +169,6 @@
|
||||||
;; split/collapse-text : (instanceof menu%) (instanceof editor<%>) (instanceof mouse-event%) -> void
|
;; split/collapse-text : (instanceof menu%) (instanceof editor<%>) (instanceof mouse-event%) -> void
|
||||||
(define (split/collapse-text menu text event)
|
(define (split/collapse-text menu text event)
|
||||||
(when (and (is-a? text -text<%>)
|
(when (and (is-a? text -text<%>)
|
||||||
(not (send text is-frozen?))
|
|
||||||
(not (send text is-stopped?)))
|
(not (send text is-stopped?)))
|
||||||
(let* ([on-it-box (box #f)]
|
(let* ([on-it-box (box #f)]
|
||||||
[click-pos
|
[click-pos
|
||||||
|
@ -427,7 +426,6 @@
|
||||||
get-end-position
|
get-end-position
|
||||||
flash-on
|
flash-on
|
||||||
insert
|
insert
|
||||||
is-frozen?
|
|
||||||
is-stopped?
|
is-stopped?
|
||||||
kill
|
kill
|
||||||
last-position
|
last-position
|
||||||
|
@ -457,7 +455,7 @@
|
||||||
(define/override (get-word-at current-pos)
|
(define/override (get-word-at current-pos)
|
||||||
(let ([no-word ""])
|
(let ([no-word ""])
|
||||||
(cond
|
(cond
|
||||||
[(or (is-stopped?) (is-frozen?))
|
[(is-stopped?)
|
||||||
no-word]
|
no-word]
|
||||||
[else
|
[else
|
||||||
(let ([type (classify-position (max 0 (- current-pos 1)))])
|
(let ([type (classify-position (max 0 (- current-pos 1)))])
|
||||||
|
@ -493,7 +491,7 @@
|
||||||
|
|
||||||
(define/public (tabify-on-return?) #t)
|
(define/public (tabify-on-return?) #t)
|
||||||
(define/public (tabify [pos (get-start-position)])
|
(define/public (tabify [pos (get-start-position)])
|
||||||
(unless (or (is-stopped?) (is-frozen?))
|
(unless (is-stopped?)
|
||||||
(let* ([tabify-prefs (preferences:get 'framework:tabify)]
|
(let* ([tabify-prefs (preferences:get 'framework:tabify)]
|
||||||
[last-pos (last-position)]
|
[last-pos (last-position)]
|
||||||
[para (position-paragraph pos)]
|
[para (position-paragraph pos)]
|
||||||
|
@ -701,7 +699,7 @@
|
||||||
|
|
||||||
(define/public (tabify-selection [start-pos (get-start-position)]
|
(define/public (tabify-selection [start-pos (get-start-position)]
|
||||||
[end-pos (get-end-position)])
|
[end-pos (get-end-position)])
|
||||||
(unless (or (is-frozen?) (is-stopped?))
|
(unless (is-stopped?)
|
||||||
(define first-para (position-paragraph start-pos))
|
(define first-para (position-paragraph start-pos))
|
||||||
(define end-para (position-paragraph end-pos))
|
(define end-para (position-paragraph end-pos))
|
||||||
(with-handlers ([exn:break?
|
(with-handlers ([exn:break?
|
||||||
|
@ -1419,7 +1417,6 @@
|
||||||
(λ (text)
|
(λ (text)
|
||||||
(cond
|
(cond
|
||||||
[(or (not (preferences:get 'framework:fixup-open-parens))
|
[(or (not (preferences:get 'framework:fixup-open-parens))
|
||||||
(send text is-frozen?)
|
|
||||||
(send text is-stopped?))
|
(send text is-stopped?))
|
||||||
(maybe-insert-brace-pair text #\[ #\])]
|
(maybe-insert-brace-pair text #\[ #\])]
|
||||||
[else
|
[else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user