Skip to content

Commit

Permalink
(chord_composer): do not show blank chord prompt
Browse files Browse the repository at this point in the history
optimize for the scenario that space key opens preview popup in Mac finder
  • Loading branch information
lotem committed Jul 31, 2024
1 parent eaeb845 commit 7bfde7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rime/gear/chord_composer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ void ChordComposer::UpdateChord(const Chord& chord) {
return;
Context* ctx = engine_->context();
Composition& comp = ctx->composition();
// do not show chord prompt if the chord is empty or only contains space.
if (chord.empty() || (chord.size() == 1 && chord.count(' ') > 0)) {
ClearChord();
return;
}
string code = SerializeChord(chord);
prompt_format_.Apply(&code);
if (comp.empty()) {
Expand Down

0 comments on commit 7bfde7b

Please sign in to comment.