From 25057e59b7e5914185854eda2e33bc1fe49c6a31 Mon Sep 17 00:00:00 2001 From: stippi Date: Wed, 21 Apr 2010 11:49:28 +0000 Subject: [PATCH] When selecting choices in the auto-completion pop-up, insert the current choice into the text view, so the user can continue typing from that choice, or modify it. For example, one can type "dev.haiku-os.org", select a choice "http://dev.haiku-os.org/ticket/1234" and then replace just the last chunk with another ticket number and press enter. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@447 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/autocompletion/TextViewCompleter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/apps/webpositive/autocompletion/TextViewCompleter.cpp b/src/apps/webpositive/autocompletion/TextViewCompleter.cpp index 5ae515b529..9f0a90b065 100644 --- a/src/apps/webpositive/autocompletion/TextViewCompleter.cpp +++ b/src/apps/webpositive/autocompletion/TextViewCompleter.cpp @@ -94,9 +94,15 @@ TextViewCompleter::Filter(BMessage* message, BHandler** target) switch (bytes[0]) { case B_UP_ARROW: SelectPrevious(); + // Insert the current choice into the text view, so the user can + // continue typing. This will not trigger another evaluation, since + // we don't invoke EditViewStateChanged(). + ApplyChoice(false); return B_SKIP_MESSAGE; case B_DOWN_ARROW: SelectNext(); + // See above. + ApplyChoice(false); return B_SKIP_MESSAGE; case B_ESCAPE: CancelChoice();