Skip to content

Commit d76a3c3

Browse files
authored
fix action label empty for multi-switch without reset (#140)
1 parent f1b4b01 commit d76a3c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rimeaction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ SelectAction::SelectAction(RimeEngine *engine, std::string_view schema,
122122
std::string SelectAction::shortText(InputContext *ic) const {
123123
auto *state = engine_->state(ic);
124124
auto *api = engine_->api();
125-
if (!state) {
125+
if (!state || texts_.empty()) {
126126
return "";
127127
}
128128
auto session = state->session();
@@ -131,7 +131,7 @@ std::string SelectAction::shortText(InputContext *ic) const {
131131
return texts_[i];
132132
}
133133
}
134-
return "";
134+
return texts_[0];
135135
}
136136

137137
std::optional<std::string> SelectAction::snapshotOption(InputContext *ic) {

0 commit comments

Comments
 (0)