Autocomplete creates selection over auto-completed text

This commit is contained in:
Corey Johnson
2012-04-16 15:36:45 -07:00
parent eacb21ca1a
commit e40040c573
2 changed files with 4 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ class Autocomplete
if match = @matches(prefix, suffix)[0]
@editor.insertText(match[1])
@editor.setSelectionBufferRange([position, [position.row, position.column + match[1].length]])
matches: (prefix, suffix) ->
regex = new RegExp("^#{prefix}(.+)#{suffix}$", "i")