From d4127dc7cd2add6308cf30edc85feb3ff5a595a4 Mon Sep 17 00:00:00 2001 From: Luis Useche Date: Wed, 24 Apr 2024 21:53:24 -0700 Subject: [PATCH] Add line number to global search. --- helix-term/src/commands.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 1f9ba0104fa00..f2f996d061286 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -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() @@ -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| {