Skip to content

Commit

Permalink
Add line number to global search.
Browse files Browse the repository at this point in the history
  • Loading branch information
useche committed Apr 25, 2024
1 parent 013d0da commit d4127dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,9 @@ fn global_search(cx: &mut Context) {
};

let columns = vec![
PickerColumn::new("line#", |item: &FileResult, _| {
(item.line_num + 1).to_string().into()
}),
PickerColumn::new("path", |item: &FileResult, _| {
helix_stdx::path::get_relative_path(&item.path)
.to_string_lossy()
Expand Down Expand Up @@ -2404,7 +2407,7 @@ fn global_search(cx: &mut Context) {

let picker = Picker::new(
columns,
1, // contents
2, // contents
vec![],
config,
move |cx, FileResult { path, line_num, .. }, action| {
Expand Down

0 comments on commit d4127dc

Please sign in to comment.