summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames <89495599+IAKOBVS@users.noreply.github.com>2023-10-17 07:23:48 +0700
committerGitHub <noreply@github.com>2023-10-17 07:23:48 +0700
commit162cafb60b9c14dfa6cf0eeea7dda0206c44501a (patch)
treedf8f2c0fa4091354fb49f8790ac868b7e43abb94
parent3b0ee03e657976b39771cf8ee3317bcdf5212324 (diff)
downloadPerlNavigator-162cafb60b9c14dfa6cf0eeea7dda0206c44501a.zip
Update completion.ts
-rw-r--r--server/src/completion.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/src/completion.ts b/server/src/completion.ts
index 69a8e37..3129d1b 100644
--- a/server/src/completion.ts
+++ b/server/src/completion.ts
@@ -44,7 +44,7 @@ function getPrefix(text: string, position: number): CompletionPrefix {
const canShift = (c: string) => /[\w\:\>\-]/.exec(c);
let l = position - 1; // left
for (; l >= 0 && canShift(text[l]); --l);
- if (l < 0 && text[l] != "$" && text[l] != "@" && text[l] != "%") ++l;
+ if (l < 0 || text[l] != "$" && text[l] != "@" && text[l] != "%") ++l;
const symbol = text.substring(l, position);
return { symbol: symbol, charStart: l, charEnd: position };
}