Skip to content

Commit

Permalink
Merge pull request #2494 from midichef/sort_col_not_name
Browse files Browse the repository at this point in the history
[sort-] order with Columns ASAP, not colnames
  • Loading branch information
anjakefala authored Aug 10, 2024
2 parents 253e314 + 07e7406 commit f5c07df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions visidata/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ def sort(self):
return
try:
with Progress(gerund='sorting', total=self.nRows) as prog:
ordering = self.ordering
# replace ambiguous colname strings with unambiguous Column objects #2494
self._ordering = self.ordering
def _sortkey(r):
prog.addProgress(1)
return self.sortkey(r, ordering=ordering)
return self.sortkey(r, ordering=self._ordering)

# must not reassign self.rows: use .sort() instead of sorted()
self.rows.sort(key=_sortkey)
Expand Down

0 comments on commit f5c07df

Please sign in to comment.