aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/picker.rs
diff options
context:
space:
mode:
authorGokul Soumya2022-12-25 05:54:09 +0000
committerBlaž Hrastnik2023-01-18 05:19:32 +0000
commit5c7db7aed54f52b3af6102517f81c9d70bb6d1fb (patch)
treea49faaa0ceb633c09b908bfe249d2f9b4a935680 /helix-term/src/ui/picker.rs
parentb2837ff3bea286ce7ccfba9b6fbcd861977caf83 (diff)
Replace menu::Item::{row, label} with format()
Diffstat (limited to 'helix-term/src/ui/picker.rs')
-rw-r--r--helix-term/src/ui/picker.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index 05738ccf..ccf37eb2 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -410,10 +410,10 @@ impl<T: Item> Picker<T> {
let n = options
.first()
- .map(|option| option.row(&editor_data).cells.len())
+ .map(|option| option.format(&editor_data).cells.len())
.unwrap_or_default();
let max_lens = options.iter().fold(vec![0; n], |mut acc, option| {
- let row = option.row(&editor_data);
+ let row = option.format(&editor_data);
// maintain max for each column
for (acc, cell) in acc.iter_mut().zip(row.cells.iter()) {
let width = cell.content.width();
@@ -729,7 +729,7 @@ impl<T: Item + 'static> Component for Picker<T> {
.skip(offset)
.take(rows as usize)
.map(|pmatch| &self.options[pmatch.index])
- .map(|option| option.row(&self.editor_data))
+ .map(|option| option.format(&self.editor_data))
.map(|mut row| {
const TEMP_CELL_SEP: &str = " ";