From 42ca903215017fb436f4226d31d5744a197f427f Mon Sep 17 00:00:00 2001 From: Atila Neves Date: Tue, 30 Jun 2015 14:40:45 +0200 Subject: [PATCH] Fix autocomplete bug introduced by c5c342d --- src/autocomplete.d | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/autocomplete.d b/src/autocomplete.d index 9c610d4..40b276d 100644 --- a/src/autocomplete.d +++ b/src/autocomplete.d @@ -229,13 +229,13 @@ 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]; } + + significantTokenType = tok!"identifier"; + beforeTokens = beforeTokens[0 .. $ - 1]; } else if (beforeTokens.length >= 2 && beforeTokens[$ - 1] == tok!".") significantTokenType = beforeTokens[$ - 2].type;