@@ -89,6 +89,7 @@ private List<Result> CreateResultsFromProcesses(List<ProcessResult> processlist,
8989 SubTitle = path ,
9090 TitleHighlightData = StringMatcher . FuzzySearch ( termToSearch , p . ProcessName ) . MatchData ,
9191 Score = pr . Score ,
92+ ContextData = p . ProcessName ,
9293 Action = ( c ) =>
9394 {
9495 processHelper . TryKill ( p ) ;
@@ -101,14 +102,14 @@ private List<Result> CreateResultsFromProcesses(List<ProcessResult> processlist,
101102
102103 // When there are multiple results AND all of them are instances of the same executable
103104 // add a quick option to kill them all at the top of the results.
104- var firstResult = sortedResults . FirstOrDefault ( ) ? . SubTitle ;
105- if ( processlist . Count > 1 && ! string . IsNullOrEmpty ( termToSearch ) && sortedResults . All ( r => r . SubTitle == firstResult ) )
105+ var firstResult = sortedResults . FirstOrDefault ( x => ! string . IsNullOrEmpty ( x . SubTitle ) ) ;
106+ if ( processlist . Count > 1 && ! string . IsNullOrEmpty ( termToSearch ) && sortedResults . All ( r => r . SubTitle == firstResult ? . SubTitle ) )
106107 {
107108 sortedResults . Insert ( 1 , new Result ( )
108109 {
109- IcoPath = "Images/app.png" ,
110- Title = string . Format ( _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_kill_all" ) , termToSearch ) ,
111- SubTitle = "" ,
110+ IcoPath = firstResult ? . IcoPath ,
111+ Title = string . Format ( _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_kill_all" ) , firstResult ? . ContextData ) ,
112+ SubTitle = string . Format ( _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_kill_all_count" ) , processlist . Count ) ,
112113 Score = 200 ,
113114 Action = ( c ) =>
114115 {
0 commit comments