Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions shell/platform/common/text_input_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ void TextInputModel::UpdateComposingText(const std::u16string& text,
composing_range_.collapsed() ? selection_ : composing_range_;
text_.replace(rangeToDelete.start(), rangeToDelete.length(), text);
composing_range_.set_end(composing_range_.start() + text.length());
selection_ = TextRange(selection.start() + composing_range_.start(),
selection.extent() + composing_range_.start());
selection_ = TextRange(composing_range_.end());
}

void TextInputModel::UpdateComposingText(const std::u16string& text) {
Expand Down
1 change: 1 addition & 0 deletions shell/platform/windows/text_input_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ void TextInputPlugin::ComposeChangeHook(const std::u16string& text,
std::string text_before_change = active_model_->GetText();
TextRange composing_before_change = active_model_->composing_range();
active_model_->AddText(text);
cursor_pos += active_model_->composing_range().extent();
active_model_->UpdateComposingText(text, TextRange(cursor_pos, cursor_pos));
std::string text_after_change = active_model_->GetText();
if (enable_delta_model) {
Expand Down