Skip to content

Commit 9ada7db

Browse files
committed
Enable dynamic indent per dock line
1 parent 0bd711b commit 9ada7db

File tree

3 files changed

+180
-151
lines changed

3 files changed

+180
-151
lines changed

src/MultiReplacePanel.cpp

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6161,7 +6161,7 @@ void MultiReplace::handleFindAllButton()
61616161
}
61626162

61636163
// (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)";
61656165

61666166
std::wstring dockText;
61676167
dock.buildListText(
@@ -6218,15 +6218,29 @@ void MultiReplace::handleFindAllButton()
62186218
}
62196219

62206220
// 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)";
62236223

6224-
std::wstring block;
6225-
dock.formatHitsForFile(wFilePath, sciSend, rawHits, block, utf8Len);
6224+
fileMap.clear(); // reuse the existing map declared at // 6)
62266225

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());
62306244
}
62316245

62326246
dock.rebuildFolding();

0 commit comments

Comments
 (0)