Make sure snippet apply method adds input.complete user event #19

Closed
jonatanklosko wants to merge 1 commit from jk-snippet-user-event into main
jonatanklosko commented 2023-12-29 17:54:59 +01:00 (Migrated from github.com)

The user event is added by insertCompletionText:

github.com/codemirror/autocomplete@ffaa367319/src/state.ts (L297-L303))

But the snippet apply doesn't add the event.

The user event is added by `insertCompletionText`: https://github.com/codemirror/autocomplete/blob/ffaa367319954cef49da50f4f42e60b876e4cc78/src/state.ts#L297-L303) But the snippet apply doesn't add the event.
marijnh commented 2024-01-01 15:12:00 +01:00 (Migrated from github.com)

It looks like the return value of insertCompletionText will already include this. Am I missing something?

It looks like the return value of `insertCompletionText` will already include this. Am I missing something?
jonatanklosko commented 2024-01-01 15:25:29 +01:00 (Migrated from github.com)

snippet(template) is a custom apply, so it falls into the second branch in the conditional above :)

`snippet(template)` is a custom `apply`, so it falls into the second branch in the conditional above :)
marijnh commented 2024-01-01 15:41:55 +01:00 (Migrated from github.com)

Ah, I see what you mean now. Attached patch adds this in a way that doesn't affect calls that don't pass a completion.

Ah, I see what you mean now. Attached patch adds this in a way that doesn't affect calls that don't pass a completion.
jonatanklosko commented 2024-01-01 15:43:10 +01:00 (Migrated from github.com)

Fantastic, thank you!

Fantastic, thank you!

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/autocomplete!19
No description provided.