Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/commands.rs')
| -rw-r--r-- | helix-term/src/commands.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 1df25ba5..b23c5278 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2243,15 +2243,13 @@ fn global_search(cx: &mut Context) { path: PathBuf, /// 0 indexed lines line_num: usize, - line_content: String, } impl FileResult { - fn new(path: &Path, line_num: usize, line_content: String) -> Self { + fn new(path: &Path, line_num: usize) -> Self { Self { path: path.to_path_buf(), line_num, - line_content, } } } @@ -2272,10 +2270,7 @@ fn global_search(cx: &mut Context) { let path = helix_stdx::path::get_relative_path(&item.path); format!("{}:{}", path.to_string_lossy(), item.line_num + 1).into() }), - PickerColumn::new("contents", |item: &FileResult, _| { - item.line_content.as_str().into() - }) - .without_filtering(), + PickerColumn::hidden("contents"), ]; let get_files = |query: &str, @@ -2355,13 +2350,9 @@ fn global_search(cx: &mut Context) { }; let mut stop = false; - let sink = sinks::UTF8(|line_num, line_content| { + let sink = sinks::UTF8(|line_num, _line_content| { stop = injector - .push(FileResult::new( - entry.path(), - line_num as usize - 1, - line_content.to_string(), - )) + .push(FileResult::new(entry.path(), line_num as usize - 1)) .is_err(); Ok(!stop) |