(commandList: SearchResult[], query: string)
| 1437 | // 在指定的指令列表中搜索(用于粘贴内容后的二次搜索) |
| 1438 | // 统一使用 search 函数,只是传入不同的指令列表 |
| 1439 | function searchInCommands(commandList: SearchResult[], query: string): SearchResult[] { |
| 1440 | if (!query || commandList.length === 0) { |
| 1441 | return commandList |
| 1442 | } |
| 1443 | |
| 1444 | // 使用统一的 search 函数 |
| 1445 | const result = search(query, commandList) |
| 1446 | return result.bestMatches |
| 1447 | } |
| 1448 | |
| 1449 | // ==================== 历史记录相关 ==================== |
| 1450 |
no test coverage detected