diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-03-23 11:19:13 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-03-23 12:53:23 +0100 |
commit | ea60bcfc2ae1e018559031a4c8a26b29caec1c59 (patch) | |
tree | 3901d11d03b7e4fc5166cff0dad07fc1e8c145a4 /qutebrowser/completion | |
parent | d9caaffa14d00fd09bd4ada11283ccedc523b680 (diff) | |
download | qutebrowser-ea60bcfc2ae1e018559031a4c8a26b29caec1c59.tar.gz qutebrowser-ea60bcfc2ae1e018559031a4c8a26b29caec1c59.zip |
Sort :process completion manually
Diffstat (limited to 'qutebrowser/completion')
-rw-r--r-- | qutebrowser/completion/models/miscmodels.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/qutebrowser/completion/models/miscmodels.py b/qutebrowser/completion/models/miscmodels.py index c284d3900..2bfb7bf93 100644 --- a/qutebrowser/completion/models/miscmodels.py +++ b/qutebrowser/completion/models/miscmodels.py @@ -312,8 +312,15 @@ def process(*, info): model = completionmodel.CompletionModel(column_widths=(10, 10, 80)) for what, processes in itertools.groupby( guiprocess.all_processes.values(), lambda proc: proc.what): + + # put successful processes last + sorted_processes = sorted( + processes, + key=lambda proc: proc.outcome.state_str() == 'successful', + ) + entries = [(str(proc.pid), proc.outcome.state_str(), str(proc)) - for proc in processes] - cat = listcategory.ListCategory(what.capitalize(), entries) + for proc in sorted_processes] + cat = listcategory.ListCategory(what.capitalize(), entries, sort=False) model.add_category(cat) return model |