mirror of https://github.com/helix-editor/helix
add history suggest to global search (#2717)
Co-authored-by: Dean Revell <revell@gmail.com>pull/2851/head
parent
8e8367eea6
commit
a17626a822
|
@ -1747,11 +1747,13 @@ fn global_search(cx: &mut Context) {
|
||||||
let smart_case = config.search.smart_case;
|
let smart_case = config.search.smart_case;
|
||||||
let file_picker_config = config.file_picker.clone();
|
let file_picker_config = config.file_picker.clone();
|
||||||
|
|
||||||
let completions = search_completions(cx, None);
|
let reg = cx.register.unwrap_or('/');
|
||||||
|
|
||||||
|
let completions = search_completions(cx, Some(reg));
|
||||||
ui::regex_prompt(
|
ui::regex_prompt(
|
||||||
cx,
|
cx,
|
||||||
"global-search:".into(),
|
"global-search:".into(),
|
||||||
None,
|
Some(reg),
|
||||||
move |_editor: &Editor, input: &str| {
|
move |_editor: &Editor, input: &str| {
|
||||||
completions
|
completions
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
@ -233,7 +233,6 @@ impl Tree {
|
||||||
{
|
{
|
||||||
if let Some(pos) = container.children.iter().position(|&child| child == index) {
|
if let Some(pos) = container.children.iter().position(|&child| child == index) {
|
||||||
container.children.remove(pos);
|
container.children.remove(pos);
|
||||||
|
|
||||||
// TODO: if container now only has one child, remove it and place child in parent
|
// TODO: if container now only has one child, remove it and place child in parent
|
||||||
if container.children.is_empty() && parent_id != self.root {
|
if container.children.is_empty() && parent_id != self.root {
|
||||||
// if container now empty, remove it
|
// if container now empty, remove it
|
||||||
|
|
Loading…
Reference in New Issue