aboutsummaryrefslogtreecommitdiff
path: root/test/functional/autocmd/completedone_spec.lua
Commit message (Collapse)AuthorAge
* test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | Problem: The magic globals `it`, `describe`, etc., are more trouble than they are worth. - Hooking into `after_each` requires `getfenv()` hacks. - They confuse luals/emmylua, because the top-level `.luarc.json` isn't merged with `test/.luarc.json` (apparently a luals limitation?) - They totally defeat discoverability because the user just has to "know" about the various magic symbols. So they harm DX, which means they serve no purpose at all. Solution: - Expose the test API from `testutil`, so tests can call `t.it()`, `t.describe()`, etc., in the conventional way. - Drop `getfenv()` hacks. - Drop the `setfenv()` injection in `load_chunk`. - Drop `test/_meta.lua`.
* fix(completion): wrong CompleteDone reason for auto-inserted sole match #38280glepnir2026-03-13
| | | | | | | | | | | | | Problem: #38169 used compl_used_match to determine the CompleteDone reason, but this fires too broadly, it also changes the reason to "accept" when the popup was shown and the user dismissed it with <Esc> or <Space>, breaking snippet completion with autocomplete. Solution: Instead of checking compl_used_match in, check whether the pum was never shown (compl_match_array == NULL) in ins_compl_stop(). When a match was inserted but the pum never displayed, set the completed word so CompleteDone fires with reason "accept". This keeps the "discard" reason intact when the user dismisses a visible pum without confirming.
* fix(completion): CompleteDone reason="discard" when candidate text remains ↵glepnir2026-03-09
| | | | | | | | | | #38169 Problem: CompleteDone fires with reason="discard" even when the candidate text was inserted and left in the buffer, because reason was determined solely by the terminating keycode (Ctrl-Y). Solution: Check compl_used_match to detect whether inserted text remains in the buffer, and set reason="accept" accordingly.
* test: remove a few more redundant clear() calls (#35903)zeertzjq2025-09-24
|
* feat(complete): CompleteDone reason "cancel", "discard" #32600Evgeni Chasnovski2025-02-23
| | | | | | | Problem: there is no way to distinguish between user's explicit completion stop/cancel and other automated reasons. Solution: update "cancel" reason to be set only on explicit CTRL-e, and set intentionally vague "discard" otherwise.
* docs: misc (#31138)dundargoc2024-11-21
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* feat(complete): specify reason for CompleteDoneFamiu Haque2024-05-24
Problem: `CompleteDone` currently does not specify the reason for why completion was done, which is problematic for completion plugins as they cannot know whether the event was triggered due to the completion being canceled, accepted, or for some other reason. Solution: Add a `reason` key to `v:event`, which is set by `CompleteDone` to indicate why completion ended.