Skip to content

Commit eaa23f5

Browse files
everyxlotem
authored andcommitted
fix: navigation actions should trigger update_notifier
1 parent 3dc802b commit eaa23f5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/rime/gear/selector.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ bool Selector::PreviousPage(Context* ctx) {
163163
int page_size = engine_->schema()->page_size();
164164
int selected_index = comp.back().selected_index;
165165
int index = selected_index < page_size ? 0 : selected_index - page_size;
166-
comp.back().selected_index = index;
166+
ctx->Highlight(index);
167167
comp.back().tags.insert("paging");
168168
return true;
169169
}
@@ -187,7 +187,7 @@ bool Selector::NextPage(Context* ctx) {
187187
} else if (index >= candidate_count) {
188188
index = candidate_count - 1;
189189
}
190-
comp.back().selected_index = index;
190+
ctx->Highlight(index);
191191
comp.back().tags.insert("paging");
192192
return true;
193193
}
@@ -209,7 +209,7 @@ bool Selector::PreviousCandidate(Context* ctx) {
209209
// in case of linear layout, fall back to navigator
210210
return !is_linear_layout(ctx);
211211
}
212-
comp.back().selected_index = index - 1;
212+
ctx->Highlight(index - 1);
213213
comp.back().tags.insert("paging");
214214
return true;
215215
}
@@ -226,7 +226,7 @@ bool Selector::NextCandidate(Context* ctx) {
226226
int candidate_count = comp.back().menu->Prepare(index + 1);
227227
if (candidate_count <= index)
228228
return true;
229-
comp.back().selected_index = index;
229+
ctx->Highlight(index);
230230
comp.back().tags.insert("paging");
231231
return true;
232232
}
@@ -236,7 +236,7 @@ bool Selector::Home(Context* ctx) {
236236
return false;
237237
Segment& seg(ctx->composition().back());
238238
if (seg.selected_index > 0) {
239-
seg.selected_index = 0;
239+
ctx->Highlight(0);
240240
return true;
241241
}
242242
// let navigator handle the key event.

0 commit comments

Comments
 (0)