#015 const bool selection_differs = (new_sel.cpMin != sel_before_change_.cpMin) ||
#016 (new_sel.cpMax != sel_before_change_.cpMax);
#017
#018 // See if the text or selection have changed since OnBeforePossibleChange().
#019 const std::wstring new_text(GetText());
#020 const bool text_differs = (new_text != text_before_change_);
#021
#022 // Update the paste state as appropriate: if we're just finishing a paste
#023 // that replaced all the text, preserve that information; otherwise, if we've
#024 // made some other edit, clear paste tracking.
#025 if (paste_state_ == REPLACING_ALL)
#026 paste_state_ = REPLACED_ALL;
#027 else if (text_differs)
#028 paste_state_ = NONE;
#029
--------------------next---------------------
#030 // If something has changed while the control key is down, prevent
#031 // "ctrl-enter" until the control key is released. When we do this, we need
#032 // to update the popup if it's open, since the desired_tld will have changed.
#033 if ((text_differs || selection_differs) &&
#034 (control_key_state_ == DOWN_WITHOUT_CHANGE)) {
#035 control_key_state_ = DOWN_WITH_CHANGE;
#036 if (!text_differs && !popup_->is_open())
#037 return false; // Don't open the popup for no reason.
#038 } else if (!text_differs &&
#039 (inline_autocomplete_text_.empty() || !selection_differs)) {
#040 return false;
#041 }
#042
#043 const bool had_keyword = !is_keyword_hint_ && !keyword_.empty();
#044
--------------------next---------------------
阅读(337) | 评论(0) | 转发(0) |