diff --git a/src/app.rs b/src/app.rs index d7f0db4..baa297b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -401,7 +401,10 @@ impl App { if should_create_new_sorter { let column_name = self .rows_view - .get_column_name_global(selected_column_index as usize); + .raw_headers() + .get(selected_column_index as usize) + .cloned() + .unwrap_or_default(); let _sorter = sort::Sorter::new( self.shared_config.clone(), selected_column_index as usize, diff --git a/src/view.rs b/src/view.rs index 3739901..733e989 100644 --- a/src/view.rs +++ b/src/view.rs @@ -284,6 +284,10 @@ impl RowsView { &self.headers } + pub fn raw_headers(&self) -> &Vec { + &self.reader.headers + } + pub fn rows(&self) -> &Vec { &self.rows } @@ -402,14 +406,6 @@ impl RowsView { self.headers[column_index].origin_index } - pub fn get_column_name_global(&self, global_column_index: usize) -> String { - self.reader - .headers - .get(global_column_index) - .cloned() - .unwrap_or_default() - } - fn get_default_headers_from_reader(reader: &CsvLensReader) -> Vec
{ reader .headers