|
|
@ -1,7 +1,7 @@
|
|
|
|
use helix_core::{
|
|
|
|
use helix_core::{
|
|
|
|
comment, graphemes,
|
|
|
|
comment, graphemes,
|
|
|
|
indent::TAB_WIDTH,
|
|
|
|
indent::TAB_WIDTH,
|
|
|
|
regex::Regex,
|
|
|
|
regex::{self, Regex},
|
|
|
|
register, selection,
|
|
|
|
register, selection,
|
|
|
|
state::{Direction, Granularity, State},
|
|
|
|
state::{Direction, Granularity, State},
|
|
|
|
ChangeSet, Range, Selection, Tendril, Transaction,
|
|
|
|
ChangeSet, Range, Selection, Tendril, Transaction,
|
|
|
@ -412,6 +412,15 @@ pub fn search_next(cx: &mut Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn search_selection(cx: &mut Context) {
|
|
|
|
|
|
|
|
let doc = cx.doc();
|
|
|
|
|
|
|
|
let contents = doc.text().slice(..);
|
|
|
|
|
|
|
|
let query = doc.selection().primary().fragment(contents);
|
|
|
|
|
|
|
|
let regex = regex::escape(&query);
|
|
|
|
|
|
|
|
register::set('\\', vec![regex]);
|
|
|
|
|
|
|
|
search_next(cx);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: N -> search_prev
|
|
|
|
// TODO: N -> search_prev
|
|
|
|
// need to loop around buffer also and show a message
|
|
|
|
// need to loop around buffer also and show a message
|
|
|
|
// same for no matches
|
|
|
|
// same for no matches
|
|
|
|