Skip to content

fix(input): keep a Return the completion menu took from typing a newline - #6

Merged
trancong12102 merged 1 commit into
mainfrom
fix/completion-enter-propagates
Oct 1, 2026
Merged

trancong12102 merged 1 commit into
mainfrom
fix/completion-enter-propagates

Conversation

@trancong12102

Copy link
Copy Markdown

The completion and code action menus called cx.propagate() at the top of handle_action, before they took the key. A key they handled therefore carried on. A real Return carries the text it types (key_char), so once the completion menu accepted an item, the newline was typed after it. The kit's own test missed this because press sends no key_char.

A key the menu takes now stops there. A key it does not take returns false as before, and the editor handles it.

Public API

None.

Tests

a_return_that_types_a_newline_accepts_without_one in crates/kit/tests/input/completions.rs dispatches a Return with its key_char. It fails without the fix (print\n) and passes with it.

Written with Claude Code (AI-generated).

The completion and code action menus called cx.propagate() before taking
a key, so a key they handled still went on. A real Return carries the text
it types, so after the menu accepted a completion the newline was typed
too. A key the menu takes now stops there.

Co-Authored-By: Claude Code
@trancong12102
trancong12102 merged commit d5b2e28 into main Oct 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant