File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -515,6 +515,17 @@ private async Task OpenResultAsync(string index)
515515 return ;
516516 }
517517
518+ // New history result must be recorded before ExecuteAsync and Hide() is called, otherwise when in 'Empty Last Query' query style mode
519+ // the QueryAsync call will reconstruct the result list without the new item.
520+ // This must happen before ExecuteAsync because some plugin actions call HideMainWindow() inside their action,
521+ // which triggers a home query that reads history before _history.Add would have been called.
522+ // Also, add item to history only if it is from results but not context menu or history.
523+ if ( queryResultsSelected )
524+ {
525+ _history . Add ( result ) ;
526+ lastHistoryIndex = 1 ;
527+ }
528+
518529 var hideWindow = false ;
519530 var isDialogJumpLeftClick = _isDialogJump && Settings . DialogJumpResultBehaviour == DialogJumpResultBehaviours . LeftClick ;
520531
@@ -541,15 +552,6 @@ private async Task OpenResultAsync(string index)
541552 } ) . ConfigureAwait ( false ) ;
542553 }
543554
544- // New history result must be recorded before Hide() is called, otherwise when in 'Empty Last Query' query style mode
545- // the QueryAsync call will reconstruct the result list without the new item.
546- // Also, add item to history only if it is from results but not context menu or history.
547- if ( queryResultsSelected )
548- {
549- _history . Add ( result ) ;
550- lastHistoryIndex = 1 ;
551- }
552-
553555 // Only hide for query results (not Dialog Jump left-click mode)
554556 if ( ! isDialogJumpLeftClick && hideWindow )
555557 {
You can’t perform that action at this time.
0 commit comments