From 5e5c835aff06853f1f9252357aaa2bc5c9dfd814 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Tue, 17 Apr 2012 17:02:53 -0700 Subject: [PATCH] :lipstick: --- src/app/autocomplete.coffee | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/autocomplete.coffee b/src/app/autocomplete.coffee index 2623f7052..09aa26de8 100644 --- a/src/app/autocomplete.coffee +++ b/src/app/autocomplete.coffee @@ -86,15 +86,13 @@ class Autocomplete extends View [prefix, suffix] = ["", ""] @currentBuffer.scanInRange @wordRegex, lineRange, (match, range, {stop}) -> + stop() if range.start.isGreaterThan(selectionRange.end) + if range.intersectsWith(selectionRange) prefixOffset = selectionRange.start.column - range.start.column suffixOffset = selectionRange.end.column - range.end.column - if range.start.isLessThan(selectionRange.start) - prefix = match[0][0...prefixOffset] - - if range.end.isGreaterThan(selectionRange.end) - suffix = match[0][suffixOffset..] - stop() + prefix = match[0][0...prefixOffset] if range.start.isLessThan(selectionRange.start) + suffix = match[0][suffixOffset..] if range.end.isGreaterThan(selectionRange.end) {prefix, suffix}