Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
index ca7e4c575737eca669711b7c6a025afbb7c9694d..35e5dd435267cce2d68b8de6a2202edc5423d1fa 100644 |
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
@@ -1418,6 +1418,21 @@ LRESULT OmniboxViewWin::OnImeComposition(UINT message, |
return result; |
} |
+ |
+LRESULT OmniboxViewWin::OnImeEndComposition(UINT message, WPARAM wparam, |
+ LPARAM lparam) { |
+ // The edit control auto-clears the selection on WM_IME_ENDCOMPOSITION, which |
+ // means any inline autocompletion we were showing will no longer be |
+ // selected, and therefore no longer replaced by further user typing. To |
+ // avoid this we manually restore the original selection after the edit |
+ // handles the message. |
+ CHARRANGE range; |
+ GetSel(range); |
+ LRESULT result = DefWindowProc(message, wparam, lparam); |
+ SetSel(range); |
+ return result; |
+} |
+ |
LRESULT OmniboxViewWin::OnImeNotify(UINT message, |
WPARAM wparam, |
LPARAM lparam) { |