File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Plugins/Flow.Launcher.Plugin.ProcessKiller Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -94,12 +94,14 @@ private List<Result> CreateResultsFromProcesses(List<ProcessResult> processlist,
94
94
} ) ;
95
95
}
96
96
97
+ var sortedResults = results . OrderBy ( x => x . Title ) . ToList ( ) ;
98
+
97
99
// When there are multiple results AND all of them are instances of the same executable
98
100
// add a quick option to kill them all at the top of the results.
99
- var firstResult = results . FirstOrDefault ( ) ? . SubTitle ;
100
- if ( processlist . Count > 1 && ! string . IsNullOrEmpty ( termToSearch ) && results . All ( r => r . SubTitle == firstResult ) )
101
+ var firstResult = sortedResults . FirstOrDefault ( ) ? . SubTitle ;
102
+ if ( processlist . Count > 1 && ! string . IsNullOrEmpty ( termToSearch ) && sortedResults . All ( r => r . SubTitle == firstResult ) )
101
103
{
102
- results . Insert ( 0 , new Result ( )
104
+ sortedResults . Insert ( 1 , new Result ( )
103
105
{
104
106
IcoPath = "Images/app.png" ,
105
107
Title = string . Format ( _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_kill_all" ) , termToSearch ) ,
@@ -117,7 +119,7 @@ private List<Result> CreateResultsFromProcesses(List<ProcessResult> processlist,
117
119
} ) ;
118
120
}
119
121
120
- return results ;
122
+ return sortedResults ;
121
123
}
122
124
}
123
125
}
You can’t perform that action at this time.
0 commit comments