From e2acd2ee3a8937496db4ec7951365dea2e4ca4ea Mon Sep 17 00:00:00 2001 From: Luis Useche Date: Thu, 25 Apr 2024 22:06:12 -0700 Subject: [PATCH] Add line number column to global search picker. --- 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 1c91510dcd928..428d7d0c2b1a3 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 = [ + 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 [], config, move |cx, FileResult { path, line_num, .. }, action| {