fix hinting on non-ascii characters

This commit is contained in:
dloverin committed 2013-05-17 07:43:08 -04:00
1 parent 03992b9198
commit 8642920d8c
7 files changed
+144 -75

No files matched your search

@@ -203,16 +203,23 @@ define(function (require, exports, module) {
Session.prototype.getQuery = function () {
var cursor = this.getCursor(),
token = this.getToken(cursor),
query = "";
query = "",
start = cursor.ch,
end = start;
if (token) {
// If the token string is not an identifier, then the query string
// is empty.
if (HintUtils.maybeIdentifier(token.string)) {
query = token.string.substring(0, token.string.length - (token.end - cursor.ch));
query = query.trim();
var line = this.getLine(cursor.line);
while (start > 0) {
if (HintUtils.maybeIdentifier(line[start - 1])) {
start--;
} else {
break;
}
}
query = line.substring(start, end);
}
return query;
};