diff --git a/src/completionDecoration.ts b/src/completionDecoration.ts index cfcb0f0..2e24a5a 100644 --- a/src/completionDecoration.ts +++ b/src/completionDecoration.ts @@ -23,9 +23,9 @@ export const completionDecoration = StateField.define({ const decorations = Decoration.set( effect.value.suggestions.map((suggestion) => { const endGhostText = - suggestion.cursorPos + suggestion.displayText.length; + suggestion.startPos + suggestion.displayText.length; let range = ghostMark.range( - decorationOffset + suggestion.cursorPos, + decorationOffset + suggestion.startPos, decorationOffset + endGhostText, ); decorationOffset += suggestion.displayText.length;