| Index: components/omnibox/browser/omnibox_edit_model.cc
|
| diff --git a/components/omnibox/browser/omnibox_edit_model.cc b/components/omnibox/browser/omnibox_edit_model.cc
|
| index e9fd507c1c66e3999e1de6bffcfd1fd5b7fe8ed6..4868f41073bc83a27576bb819519e1121b751e65 100644
|
| --- a/components/omnibox/browser/omnibox_edit_model.cc
|
| +++ b/components/omnibox/browser/omnibox_edit_model.cc
|
| @@ -372,9 +372,11 @@ void OmniboxEditModel::Revert() {
|
| has_temporary_text_ = false;
|
| size_t start, end;
|
| view_->GetSelectionBounds(&start, &end);
|
| - view_->SetWindowTextAndCaretPos(permanent_text_, 0, false, false);
|
| - view_->SetWindowTextAndCaretPos(
|
| - permanent_text_, std::min(permanent_text_.length(), start), false, true);
|
| + // First home the cursor, so view of text is scrolled to left, then correct
|
| + // it. |SetCaretPos()| doesn't scroll the text, so doing that first wouldn't
|
| + // accomplish anything.
|
| + view_->SetWindowTextAndCaretPos(permanent_text_, 0, false, true);
|
| + view_->SetCaretPos(std::min(permanent_text_.length(), start));
|
| client_->OnRevert();
|
| }
|
|
|
|
|