Skip to content

Commit

Permalink
fix: Fix multi-range completions.
Browse files Browse the repository at this point in the history
Fixes #18
  • Loading branch information
tmcw committed Apr 4, 2024
1 parent 982bd39 commit cce2d40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/completionDecoration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export const completionDecoration = StateField.define<CompletionState>({
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;
Expand Down

0 comments on commit cce2d40

Please sign in to comment.