Merge pull request #226 from atilaneves/fix_fix_range_error

Fix autocomplete bug introduced by c5c342d
This commit is contained in:
Brian Schott 2015-06-30 13:45:01 -07:00
commit 10a21881b7
1 changed files with 4 additions and 4 deletions

View File

@ -229,14 +229,14 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens,
// responses when the cursor is in the middle of an identifier instead
// of at the end
auto t = beforeTokens[$ - 1];
if (cursorPosition - t.index >= 0 && cursorPosition - t.index < t.text.length)
if (cursorPosition - t.index >= 0 && cursorPosition - t.index <= t.text.length)
{
partial = t.text[0 .. cursorPosition - t.index];
}
significantTokenType = tok!"identifier";
beforeTokens = beforeTokens[0 .. $ - 1];
}
}
else if (beforeTokens.length >= 2 && beforeTokens[$ - 1] == tok!".")
significantTokenType = beforeTokens[$ - 2].type;
else