@@ -193,7 +193,7 @@ pub fn check_cursor_in_view(view: &View) -> bool {
193 let line = doc.text().char_to_line(cursor);
193 let line = doc.text().char_to_line(cursor);
194 let document_end = view.first_line + view.area.height.saturating_sub(1) as usize;
194 let document_end = view.first_line + view.area.height.saturating_sub(1) as usize;
196− if (line > document_end.saturating_sub(PADDING)) | (line < view.first_line + PADDING) {
196+ if (line > document_end.saturating_sub(PADDING)) || (line < view.first_line + PADDING) {
197 return false;
197 return false;
@@ -304,7 +304,9 @@ pub fn select_all(cx: &mut Context) {
304pub fn select_regex(cx: &mut Context) {
304pub fn select_regex(cx: &mut Context) {
305 let prompt = ui::regex_prompt(cx, "select:".to_string(), |doc, regex| {
305 let prompt = ui::regex_prompt(cx, "select:".to_string(), |doc, regex| {
306 let text = &doc.text().slice(..);
306 let text = &doc.text().slice(..);
307+ // TODO: if select on matches returns empty range, we need to abort
307− let selection = selection::select_on_matches(text, doc.selection(), ®ex);
309+ selection::select_on_matches(text, doc.selection(), ®ex).expect("no matches");
308 doc.set_selection(selection);
310 doc.set_selection(selection);
310 cx.callback = Some(Box::new(
312 cx.callback = Some(Box::new(