Skip to content

Replace second index parameter of custom-completion closures with a String prefix parameter #769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rgoldberg opened this issue May 13, 2025 · 0 comments · Fixed by #770
Closed

Comments

@rgoldberg
Copy link
Contributor

rgoldberg commented May 13, 2025

@natecook1000 @rauhul I think this is an urgent fix that should be merged before any new version is released.

I will make a PR now.

Replace the cursor index within completing word parameter of custom-completion closures with a String completionPrefix parameter.

Most of the time, a completion function will just want the prefix of the word being completed before the cursor.

Code shouldn't have to be complex to get it, but I didn't realize how cumbersome Int indices are for Swift Strings (I'm fairly new to Swift).

Code can easily get the index from the prefix. This should be a much nicer experience for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant