@@ -348,28 +348,34 @@ where
349 // need to wait for next key
349 // need to wait for next key
350 cx.on_next_key(move |cx, event| {
350 cx.on_next_key(move |cx, event| {
352− code: KeyCode::Char(ch),
354− } = event
351+ let ch = match event {
356− let (view, doc) = cx.current();
353+ code: KeyCode::Enter,
357− let text = doc.text().slice(..);
354+ ..
357+ code: KeyCode::Char(ch),
359− let selection = doc.selection(view.id).transform(|mut range| {
363+ let (view, doc) = cx.current();
360− search_fn(text, ch, range.head, count, inclusive).map_or(range, |pos| {
364+ let text = doc.text().slice(..);
362− Range::new(range.anchor, pos)
365− Range::new(range.head, pos)
367− // or (pos, pos) to move to found val
366+ let selection = doc.selection(view.id).transform(|mut range| {
367+ search_fn(text, ch, range.head, count, inclusive).map_or(range, |pos| {
369+ Range::new(range.anchor, pos)
372+ Range::new(range.head, pos)
374+ // or (pos, pos) to move to found val
371− doc.set_selection(view.id, selection);
378+ doc.set_selection(view.id, selection);