@@ -6161,7 +6161,7 @@ void MultiReplace::handleFindAllButton()
6161
6161
}
6162
6162
6163
6163
// (d) Build dock text
6164
- std::wstring header = L" Search in List (" + std::to_wstring (totalHits) + L" hits in 1 file)\r\n " ;
6164
+ std::wstring header = L" Search in List (" + std::to_wstring (totalHits) + L" hits in 1 file)" ;
6165
6165
6166
6166
std::wstring dockText;
6167
6167
dock.buildListText (
@@ -6218,15 +6218,29 @@ void MultiReplace::handleFindAllButton()
6218
6218
}
6219
6219
6220
6220
// header
6221
- std::wstring header = L" Search \" " + headerPattern + L" \" (" + std::to_wstring (rawHits. size ()) + L" hits in 1 file) \r\n " ;
6222
- size_t utf8Len = Encoding::wstringToUtf8 (header) .size ();
6221
+ std::wstring header = L" Search \" " + headerPattern + L" \" (" +
6222
+ std::to_wstring (rawHits .size ()) + L" hits in 1 file) " ;
6223
6223
6224
- std::wstring block;
6225
- dock.formatHitsForFile (wFilePath, sciSend, rawHits, block, utf8Len);
6224
+ fileMap.clear (); // reuse the existing map declared at // 6)
6226
6225
6227
- allHits = std::move (rawHits);
6228
- dock.prependHits (allHits, header + block);
6229
- totalHits = (int )allHits.size ();
6226
+ {
6227
+ auto & agg = fileMap[utf8FilePath];
6228
+ agg.wPath = wFilePath;
6229
+ agg.hitCount = static_cast <int >(rawHits.size ());
6230
+ agg.crits .push_back ({ headerPattern, std::move (rawHits) });
6231
+ }
6232
+
6233
+ std::wstring dockText;
6234
+ dock.buildListText (
6235
+ /* files */ fileMap,
6236
+ /* groupView */ false , // flat list output
6237
+ /* header */ header,
6238
+ /* sciSend */ sciSend,
6239
+ /* outText */ dockText,
6240
+ /* outHits */ allHits);
6241
+
6242
+ dock.prependHits (allHits, dockText);
6243
+ totalHits = static_cast <int >(allHits.size ());
6230
6244
}
6231
6245
6232
6246
dock.rebuildFolding ();
0 commit comments