fixes
svn: r7299
This commit is contained in:
parent
34c85bd9ef
commit
109ecfc184
|
@ -68,7 +68,7 @@
|
||||||
(parameter/c string?)
|
(parameter/c string?)
|
||||||
()
|
()
|
||||||
"A string that is inserted after a completions is inserted by a"
|
"A string that is inserted after a completions is inserted by a"
|
||||||
"@ilink text:autocomplete<%>"
|
"@ilink text:autocomplete"
|
||||||
"instance."
|
"instance."
|
||||||
""
|
""
|
||||||
"Defaults to \"\"")
|
"Defaults to \"\"")
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
()
|
()
|
||||||
"Controls the number of completions visible at a time in the menu"
|
"Controls the number of completions visible at a time in the menu"
|
||||||
"produced by"
|
"produced by"
|
||||||
"@ilink text:autocomplete<%>"
|
"@ilink text:autocomplete"
|
||||||
"instances."
|
"instances."
|
||||||
""
|
""
|
||||||
"Defaults to 15.")
|
"Defaults to 15.")
|
||||||
|
|
|
@ -2163,6 +2163,7 @@ designates the character that triggers autocompletion
|
||||||
|
|
||||||
(define autocomplete<%>
|
(define autocomplete<%>
|
||||||
(interface ((class->interface text%))
|
(interface ((class->interface text%))
|
||||||
|
auto-complete
|
||||||
get-autocomplete-border-color
|
get-autocomplete-border-color
|
||||||
get-autocomplete-background-color
|
get-autocomplete-background-color
|
||||||
get-autocomplete-selected-color
|
get-autocomplete-selected-color
|
||||||
|
@ -2191,8 +2192,13 @@ designates the character that triggers autocompletion
|
||||||
(define/public (get-autocomplete-selected-color) "orange")
|
(define/public (get-autocomplete-selected-color) "orange")
|
||||||
|
|
||||||
(define/public (completion-mode-key-event? key-event)
|
(define/public (completion-mode-key-event? key-event)
|
||||||
(and (eq? (send key-event get-key-code) #\.)
|
(cond
|
||||||
(send key-event get-control-down)))
|
[(and (eq? (send key-event get-key-code) #\.)
|
||||||
|
(send key-event get-control-down))
|
||||||
|
(or (eq? (system-type) 'macosx)
|
||||||
|
(not (preferences:get 'framework:menu-bindings)))]
|
||||||
|
[else
|
||||||
|
#f]))
|
||||||
|
|
||||||
(define/public (get-all-words)
|
(define/public (get-all-words)
|
||||||
(get-completions/manuals
|
(get-completions/manuals
|
||||||
|
@ -2220,7 +2226,8 @@ designates the character that triggers autocompletion
|
||||||
|
|
||||||
;; (-> void)
|
;; (-> void)
|
||||||
;; Check for possible completions of the current word and give the user a menu for them.
|
;; Check for possible completions of the current word and give the user a menu for them.
|
||||||
(define/private (auto-complete)
|
(define/public-final (auto-complete)
|
||||||
|
(when (equal? (get-start-position) (get-end-position))
|
||||||
(let* ([end-pos (get-end-position)]
|
(let* ([end-pos (get-end-position)]
|
||||||
[word (get-word-at end-pos)]
|
[word (get-word-at end-pos)]
|
||||||
[completion-cursor (get-completions word)])
|
[completion-cursor (get-completions word)])
|
||||||
|
@ -2228,7 +2235,7 @@ designates the character that triggers autocompletion
|
||||||
(let ([start-pos (- end-pos (string-length word))])
|
(let ([start-pos (- end-pos (string-length word))])
|
||||||
(set! word-start-pos start-pos)
|
(set! word-start-pos start-pos)
|
||||||
(set! word-end-pos end-pos)
|
(set! word-end-pos end-pos)
|
||||||
(show-options word start-pos end-pos completion-cursor)))))
|
(show-options word start-pos end-pos completion-cursor))))))
|
||||||
|
|
||||||
;; Number -> String
|
;; Number -> String
|
||||||
;; The word that ends at the current positon of the editor
|
;; The word that ends at the current positon of the editor
|
||||||
|
@ -2279,8 +2286,7 @@ designates the character that triggers autocompletion
|
||||||
[else
|
[else
|
||||||
(destroy-completions-box)
|
(destroy-completions-box)
|
||||||
(super on-char key-event)]))]
|
(super on-char key-event)]))]
|
||||||
[(and (completion-mode-key-event? key-event)
|
[(completion-mode-key-event? key-event)
|
||||||
(equal? (get-start-position) (get-end-position)))
|
|
||||||
(auto-complete)]
|
(auto-complete)]
|
||||||
[else
|
[else
|
||||||
(super on-char key-event)]))
|
(super on-char key-event)]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user