From 990ff81a11d6135cb3390c4870c3c980a099e266 Mon Sep 17 00:00:00 2001 From: Yuku Takahashi Date: Thu, 11 Feb 2021 16:55:52 +0900 Subject: [PATCH] Use zero index correctly (#340) --- packages/textcomplete-core/src/Strategy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/textcomplete-core/src/Strategy.ts b/packages/textcomplete-core/src/Strategy.ts index f1e51262..b4983366 100644 --- a/packages/textcomplete-core/src/Strategy.ts +++ b/packages/textcomplete-core/src/Strategy.ts @@ -41,7 +41,7 @@ export class Strategy { ): boolean { const match = this.matchWithContext(beforeCursor) if (!match) return false - const term = match[this.props.index || DEFAULT_INDEX] + const term = match[this.props.index ?? DEFAULT_INDEX] this.search( term, (results: T[]) => {