diff --git a/CHANGELOG.md b/CHANGELOG.md index 5762280bb..9b3357bd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#215](https://github.com/ClementTsang/bottom/pull/215): Add labels to Linux temperature values. +- [#224](https://github.com/ClementTsang/bottom/pull/224): Implements sorting by count. It previously did absolutely nothing. + ## [0.4.7] - 2020-08-26 ### Bug Fixes diff --git a/src/lib.rs b/src/lib.rs index 58b68cb7d..7857e31c1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -663,7 +663,15 @@ fn sort_process_data( ) }), ProcessSorting::Count => { - // Nothing should happen here. + if proc_widget_state.is_grouped { + to_sort_vec.sort_by(|a, b| { + utils::gen_util::get_ordering( + a.group_pids.len(), + b.group_pids.len(), + proc_widget_state.process_sorting_reverse, + ) + }); + } } } }