Index: ui/views/controls/textfield/textfield_views_model.cc |
diff --git a/ui/views/controls/textfield/textfield_views_model.cc b/ui/views/controls/textfield/textfield_views_model.cc |
index 5c509865363922aef86cd3dc26459aa4ad7eea88..9524903db9980fe795fe753446b76526bc084fb4 100644 |
--- a/ui/views/controls/textfield/textfield_views_model.cc |
+++ b/ui/views/controls/textfield/textfield_views_model.cc |
@@ -58,8 +58,8 @@ class Edit { |
// successful, or false otherwise. Merged edit will be deleted after |
// redo and should not be reused. |
bool Merge(const Edit* edit) { |
- if (edit->merge_with_previous()) { |
- MergeSet(edit); |
+ if (type_ != DELETE_EDIT && edit->merge_with_previous()) { |
msw
2011/12/07 00:55:22
Interesting, please comment why DELETE_EDIT doesn'
oshima
2011/12/07 01:17:24
Done. I also improved the test to make this point
|
+ MergeReplace(edit); |
return true; |
} |
return mergeable() && edit->mergeable() && DoMerge(edit); |
@@ -113,10 +113,10 @@ class Edit { |
// Returns the end index of the |new_text_|. |
size_t new_text_end() const { return new_text_start_ + new_text_.length(); } |
- // Merge the Set edit into the current edit. This is a special case to |
+ // Merge the replace edit into the current edit. This is a special case to |
// handle an omnibox setting autocomplete string after new character is |
// typed in. |
- void MergeSet(const Edit* edit) { |
+ void MergeReplace(const Edit* edit) { |
CHECK_EQ(REPLACE_EDIT, edit->type_); |
CHECK_EQ(0U, edit->old_text_start_); |
CHECK_EQ(0U, edit->new_text_start_); |