fix(cli): search limit counts visible results, filter before cap
Pass 0 (unlimited) to m.Search so the mail layer returns all matching headers; the existing post-filter loop already caps at the caller's limit, mirroring ListCmd. Add TestSearchLimitCountsVisibleOnly to prove filtering happens before the cap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -187,7 +187,7 @@ func SearchCmd(d Deps, account, folder string, sc mail.SearchCriteria, limit int
|
||||
return d.emit(*fail)
|
||||
}
|
||||
defer done()
|
||||
headers, err := m.Search(folder, sc, limit)
|
||||
headers, err := m.Search(folder, sc, 0)
|
||||
if err != nil {
|
||||
return d.emit(Failure(CodeNetwork, err.Error()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user