Skip to content

Commit f77d528

Browse files
committed
fix action label empty for multi-switch without reset
1 parent f1b4b01 commit f77d528

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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)