Skip to content

Commit

Permalink
Turn ime_in_progress_ off when composition text is nothing
Browse files Browse the repository at this point in the history
(cherry-picked from commit 16a8ac7)
  • Loading branch information
fujimo-t authored and jyrkive committed Oct 7, 2018
1 parent cf606d2 commit adda2d3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gui/widgets/text_box_base.cpp
Expand Up @@ -382,6 +382,12 @@ void text_box_base::handle_key_backspace(SDL_Keymod /*modifier*/, bool& handled)
delete_selection();
} else if(selection_start_) {
delete_char(true);
if(ime_in_progress_) {
if(utf8::size(text_.text()) <= utf8::size(text_cached_)) {
ime_in_progress_ = false;
ime_length_ = 0;
}
}
}
fire(event::NOTIFY_MODIFIED, *this, nullptr);
}
Expand All @@ -395,6 +401,12 @@ void text_box_base::handle_key_delete(SDL_Keymod /*modifier*/, bool& handled)
delete_selection();
} else if(selection_start_ < text_.get_length()) {
delete_char(false);
if(ime_in_progress_) {
if(utf8::size(text_.text()) <= utf8::size(text_cached_)) {
ime_in_progress_ = false;
ime_length_ = 0;
}
}
}
fire(event::NOTIFY_MODIFIED, *this, nullptr);
}
Expand Down

0 comments on commit adda2d3

Please sign in to comment.