mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-30 20:45:26 +00:00
Try to show some search results, if no space for full data.
This commit is contained in:
@@ -890,7 +890,14 @@ std::string TracyLlmTools::SourceSearch( std::string query, bool caseInsensitive
|
||||
|
||||
if( total == 0 ) return "No matches found.";
|
||||
auto ret = json.dump( 2, ' ', false, nlohmann::json::error_handler_t::replace );
|
||||
if( ret.size() > CalcMaxSize() ) return "Too many matches found.";
|
||||
if( json.size() > 1 && ret.size() > CalcMaxSize() )
|
||||
{
|
||||
for( auto& item : json ) item.erase( "matches" );
|
||||
json["hint"] = "Too many matches found to show all data. Narrow down the search to get line numbers.";
|
||||
|
||||
ret = json.dump( 2, ' ', false, nlohmann::json::error_handler_t::replace );
|
||||
if( ret.size() > CalcMaxSize() ) return "Too many matches found.";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user