Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,7 @@ export function useCompletionTrigger(
}

// Find trigger character before cursor
// Use text length if cursorPosition is 0 but we have text (edge case for first character)
const effectiveCursorPosition =
cursorPosition === 0 && text.length > 0 ? text.length : cursorPosition;

const textBeforeCursor = text.substring(0, effectiveCursorPosition);
const textBeforeCursor = text.substring(0, cursorPosition);
const lastAtMatch = textBeforeCursor.lastIndexOf('@');
const lastSlashMatch = textBeforeCursor.lastIndexOf('/');

Expand Down
Loading