Skip to content

Commit f1b9105

Browse files
committed
fix comment
1 parent 5ac6459 commit f1b9105

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli/src/components/multiline-input.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,10 @@ export const MultilineInput = forwardRef<
652652
if (afterNewline === -1) {
653653
afterNewline = value.length
654654
}
655-
// For some reason, there is a special case for lastIndexOf for negative indices if the match is a prefix
655+
/*
656+
* The second argument of lastIndexOf is converted to 0 if it's
657+
* negative, so we need to special case cursorPosition === 0
658+
*/
656659
let prevNewlineExclusive =
657660
cursorPosition === 0
658661
? -1

0 commit comments

Comments
 (0)