@@ -1407,18 +1407,12 @@ window.initSearch = rawSearchIndex => {
14071407 for ( i = 0 , nSearchWords = searchWords . length ; i < nSearchWords ; ++ i ) {
14081408 row = searchIndex [ i ] ;
14091409 in_returned = checkReturned ( row , elem , parsedQuery . typeFilter ) ;
1410- addIntoResults ( results_returned , row . id , i , - 1 , in_returned ) ;
1410+ addIntoResults ( results_others , row . id , i , - 1 , in_returned ) ;
14111411 }
14121412 }
14131413 } else if ( parsedQuery . foundElems > 0 ) {
1414- let container = results_others ;
1415- // In the special case where only a "returned" information is available, we want to
1416- // put the information into the "results_returned" dict.
1417- if ( parsedQuery . returned . length !== 0 && parsedQuery . elems . length === 0 ) {
1418- container = results_returned ;
1419- }
14201414 for ( i = 0 , nSearchWords = searchWords . length ; i < nSearchWords ; ++ i ) {
1421- handleArgs ( searchIndex [ i ] , i , container ) ;
1415+ handleArgs ( searchIndex [ i ] , i , results_others ) ;
14221416 }
14231417 }
14241418 }
@@ -1723,12 +1717,17 @@ window.initSearch = rawSearchIndex => {
17231717 `${ typeFilter } </h1> in ${ crates } </div>` ;
17241718 if ( results . query . error !== null ) {
17251719 output += `<h3>Query parser error: "${ results . query . error } ".</h3>` ;
1720+ } else if ( results . query . foundElems <= 1 && results . query . returned . length === 0 ) {
1721+ output += `<div id="titles">` +
1722+ makeTabHeader ( 0 , "In Names" , ret_others [ 1 ] ) +
1723+ makeTabHeader ( 1 , "In Parameters" , ret_in_args [ 1 ] ) +
1724+ makeTabHeader ( 2 , "In Return Types" , ret_returned [ 1 ] ) +
1725+ "</div>" ;
1726+ } else {
1727+ output += '<div id="titles">' +
1728+ makeTabHeader ( 0 , "In Function Signature" , ret_others [ 1 ] ) +
1729+ "</div>" ;
17261730 }
1727- output += `<div id="titles">` +
1728- makeTabHeader ( 0 , "In Names" , ret_others [ 1 ] ) +
1729- makeTabHeader ( 1 , "In Parameters" , ret_in_args [ 1 ] ) +
1730- makeTabHeader ( 2 , "In Return Types" , ret_returned [ 1 ] ) +
1731- "</div>" ;
17321731
17331732 const resultsElem = document . createElement ( "div" ) ;
17341733 resultsElem . id = "results" ;
0 commit comments