diff --git a/crates/review/src/ui/thread/popover.rs b/crates/review/src/ui/thread/popover.rs index faa5d169d1..5c8d8f1f0b 100644 --- a/crates/review/src/ui/thread/popover.rs +++ b/crates/review/src/ui/thread/popover.rs @@ -208,6 +208,7 @@ impl ThreadPopover<'_> { .lines(COMPOSER_ROWS) .placeholder(words.reply.clone()) .complete(MentionCompleter { people: people.to_vec(), me: me.to_owned() }) + .complete_on_enter() .submits() .default_stop() .show(ui); diff --git a/crates/ui-contract/src/primitives/text_input.rs b/crates/ui-contract/src/primitives/text_input.rs index 8d9fd3edce..1e25a2f463 100644 --- a/crates/ui-contract/src/primitives/text_input.rs +++ b/crates/ui-contract/src/primitives/text_input.rs @@ -59,6 +59,8 @@ pub struct TextOptions { pub tab_inserts: bool, /// Candidates for the text before the caret. pub complete: Option>, + /// Enter accepts the highlighted candidate, as Tab does; off, Enter stays the field's own (a cell commits on it). + pub complete_on_enter: bool, /// Text that replaces the selection in the pass it is set (the caret inserts it). pub replace_selection: Option, /// Typing one of these characters commits the draft, as Enter does without submitting; the character is not @@ -102,6 +104,7 @@ impl Default for TextOptions { ink: None, tab_inserts: false, complete: None, + complete_on_enter: false, replace_selection: None, commit_on: &[], enabled: true, @@ -152,14 +155,30 @@ pub struct Completion { pub label: Label, /// The text that replaces the range. pub insert: String, - /// A second line of the row. - pub detail: Option