Skip to content

Commit 67f06a1

Browse files
committed
switched ini Option FlatList -> GroupResults
1 parent f7c61ca commit 67f06a1

File tree

4 files changed

+24
-27
lines changed

4 files changed

+24
-27
lines changed

src/MultiReplacePanel.cpp

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

61636163
// (d) Build dock text
6164-
std::wstring header =
6165-
flatListEnabled
6166-
? L"Search in List – flat (" + std::to_wstring(totalHits) + L" hits in 1 file)\r\n"
6167-
: 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)\r\n";
61686165

61696166
std::wstring dockText;
61706167
dock.buildListText(
61716168
/* files: */ fileMap,
6172-
/* flatView: */ flatListEnabled,
6169+
/* groupView:*/ groupResultsEnabled,
61736170
/* header: */ header,
61746171
/* sciSend: */ sciSend,
61756172
/* outText: */ dockText,
@@ -9968,7 +9965,7 @@ void MultiReplace::saveSettingsToIni(const std::wstring& iniFilePath) {
99689965
outFile << Encoding::wstringToUtf8(L"EditFieldSize=" + std::to_wstring(editFieldSize) + L"\n");
99699966
outFile << Encoding::wstringToUtf8(L"ListStatistics=" + std::to_wstring(listStatisticsEnabled ? 1 : 0) + L"\n");
99709967
outFile << Encoding::wstringToUtf8(L"StayAfterReplace=" + std::to_wstring(stayAfterReplaceEnabled ? 1 : 0) + L"\n");
9971-
outFile << Encoding::wstringToUtf8(L"FlatList=" + std::to_wstring(flatListEnabled) + L"\n");
9968+
outFile << Encoding::wstringToUtf8(L"GroupResults=" + std::to_wstring(groupResultsEnabled) + L"\n");
99729969

99739970
// Convert and Store the scope options
99749971
int selection = IsDlgButtonChecked(_hSelf, IDC_SELECTION_RADIO) == BST_CHECKED ? 1 : 0;
@@ -10165,7 +10162,7 @@ void MultiReplace::loadSettingsFromIni() {
1016510162

1016610163
listStatisticsEnabled = CFG.readBool(L"Options", L"ListStatistics", false);
1016710164
stayAfterReplaceEnabled = CFG.readBool(L"Options", L"StayAfterReplace", false);
10168-
flatListEnabled = CFG.readBool(L"Options", L"FlatList", false);
10165+
groupResultsEnabled = CFG.readBool(L"Options", L"GroupResults", false);
1016910166

1017010167
// Loading and setting the scope
1017110168
int selection = CFG.readInt(L"Scope", L"Selection", 0);

src/MultiReplacePanel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ class MultiReplace : public StaticDialog
611611
inline static int editFieldSize = 5; // Size of the edit field for find/replace input
612612
inline static bool listStatisticsEnabled = false; // Status for showing list statistics
613613
inline static bool stayAfterReplaceEnabled = false; // Status for keeping panel open after replace
614-
inline static bool flatListEnabled = false; // Status for flat list view
614+
inline static bool groupResultsEnabled = false; // Status for flat list view
615615

616616
bool isHoverTextSuppressed = false; // Temporarily suppress HoverText to avoid flickering when Edit in list is open
617617

src/ResultDock.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ void ResultDock::formatHitsLines(const SciSendFn& sciSend,
509509

510510
void ResultDock::buildListText(
511511
const FileMap& files,
512-
bool flatView,
512+
bool groupView,
513513
const std::wstring& header,
514514
const SciSendFn& sciSend,
515515
std::wstring& outText,
@@ -525,23 +525,7 @@ void ResultDock::buildListText(
525525
body += fileHdr;
526526
utf8Len += Encoding::wstringToUtf8(fileHdr).size();
527527

528-
if (flatView)
529-
{
530-
// flat: collect all hits per file and sort by position
531-
std::vector<Hit> merged;
532-
for (auto& c : f.crits)
533-
merged.insert(merged.end(),
534-
std::make_move_iterator(c.hits.begin()),
535-
std::make_move_iterator(c.hits.end()));
536-
std::sort(merged.begin(), merged.end(),
537-
[](auto const& a, auto const& b) { return a.pos < b.pos; });
538-
539-
formatHitsLines(sciSend, merged, body, utf8Len);
540-
outHits.insert(outHits.end(),
541-
std::make_move_iterator(merged.begin()),
542-
std::make_move_iterator(merged.end()));
543-
}
544-
else
528+
if (groupView)
545529
{
546530
// grouped: first the file header, then each criterion block
547531
for (auto& c : f.crits)
@@ -561,6 +545,22 @@ void ResultDock::buildListText(
561545
std::make_move_iterator(hitsCopy.end()));
562546
}
563547
}
548+
else
549+
{
550+
// flat: collect all hits per file and sort by position
551+
std::vector<Hit> merged;
552+
for (auto& c : f.crits)
553+
merged.insert(merged.end(),
554+
std::make_move_iterator(c.hits.begin()),
555+
std::make_move_iterator(c.hits.end()));
556+
std::sort(merged.begin(), merged.end(),
557+
[](auto const& a, auto const& b) { return a.pos < b.pos; });
558+
559+
formatHitsLines(sciSend, merged, body, utf8Len);
560+
outHits.insert(outHits.end(),
561+
std::make_move_iterator(merged.begin()),
562+
std::make_move_iterator(merged.end()));
563+
}
564564
}
565565

566566
outText = header + body;

src/ResultDock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class ResultDock final
9090
using FileMap = std::unordered_map<std::string, FileAgg>;
9191

9292
void buildListText(const FileMap& files,
93-
bool flatView,
93+
bool groupView,
9494
const std::wstring& header,
9595
const SciSendFn& sciSend,
9696
std::wstring& outText,

0 commit comments

Comments
 (0)