Skip to content

Commit 4b229af

Browse files
committed
Choosing the larger of the two between cursor and offset
1 parent 88597dd commit 4b229af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/org/javacs/kt/signaturehelp/signatureHelp.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private fun activeParameter(call: KtCallExpression, cursor: Int): Int {
109109
val text = args.text
110110
if (text.length == 2)
111111
return 0
112-
val beforeCursor = text.subSequence(0, args.textRange.startOffset - cursor)
112+
val beforeCursor = text.subSequence(0, Math.max(args.textRange.startOffset, cursor) - Math.min(args.textRange.startOffset, cursor))
113113

114114
return beforeCursor.count { it == ','}
115115
}

0 commit comments

Comments
 (0)