fixed the 'find the word behind the insertion point' function for racket-mode completion

closes PR 11800
This commit is contained in:
Robby Findler 2011-03-30 18:54:03 -05:00
parent f88621aec1
commit 82933e8019

View File

@ -457,17 +457,17 @@
[else [else
(let ([type (classify-position (max 0 (- current-pos 1)))]) (let ([type (classify-position (max 0 (- current-pos 1)))])
(cond (cond
[(eq? 'symbol type) [(memq type '(symbol keyword))
(get-text (look-for-non-symbol (max 0 (- current-pos 1))) (get-text (look-for-non-symbol/non-kwd (max 0 (- current-pos 1)))
current-pos)] current-pos)]
[else no-word]))]))) [else no-word]))])))
(define/private (look-for-non-symbol start) (define/private (look-for-non-symbol/non-kwd start)
(let loop ([i start]) (let loop ([i start])
(cond (cond
[(< i 0) [(< i 0)
0] 0]
[(eq? (classify-position i) 'symbol) [(memq (classify-position i) '(symbol keyword))
(loop (- i 1))] (loop (- i 1))]
[else [else
(+ i 1)]))) (+ i 1)])))