mirror of https://github.com/helix-editor/helix
Merge 669174c7d1
into 205e7ece70
commit
ecc8caefd1
|
@ -2663,7 +2663,8 @@ fn global_search(cx: &mut Context) {
|
||||||
Some((path.as_path().into(), Some((*line_num, *line_num))))
|
Some((path.as_path().into(), Some((*line_num, *line_num))))
|
||||||
})
|
})
|
||||||
.with_history_register(Some(reg))
|
.with_history_register(Some(reg))
|
||||||
.with_dynamic_query(get_files, Some(275));
|
.with_dynamic_query(get_files, Some(275))
|
||||||
|
.with_language("regex", std::sync::Arc::clone(&cx.editor.syn_loader));
|
||||||
|
|
||||||
cx.push_layer(Box::new(overlaid(picker)));
|
cx.push_layer(Box::new(overlaid(picker)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -440,6 +440,11 @@ impl<T: 'static + Send + Sync, D: 'static + Send + Sync> Picker<T, D> {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn with_language(mut self, language: &'static str, loader: Arc<ArcSwap<Loader>>) -> Self {
|
||||||
|
self.prompt.language = Some((language, loader));
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Move the cursor by a number of lines, either down (`Forward`) or up (`Backward`)
|
/// Move the cursor by a number of lines, either down (`Forward`) or up (`Backward`)
|
||||||
pub fn move_by(&mut self, amount: u32, direction: Direction) {
|
pub fn move_by(&mut self, amount: u32, direction: Direction) {
|
||||||
let len = self.matcher.snapshot().matched_item_count();
|
let len = self.matcher.snapshot().matched_item_count();
|
||||||
|
|
|
@ -44,7 +44,7 @@ pub struct Prompt {
|
||||||
callback_fn: CallbackFn,
|
callback_fn: CallbackFn,
|
||||||
pub doc_fn: DocFn,
|
pub doc_fn: DocFn,
|
||||||
next_char_handler: Option<PromptCharHandler>,
|
next_char_handler: Option<PromptCharHandler>,
|
||||||
language: Option<(&'static str, Arc<ArcSwap<syntax::Loader>>)>,
|
pub language: Option<(&'static str, Arc<ArcSwap<syntax::Loader>>)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||||
|
|
Loading…
Reference in New Issue