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
This commit is contained in:
stippi 2010-04-21 11:49:28 +00:00 committed by Alexandre Deckner
parent 9d15059974
commit 25057e59b7

View File

@ -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();