mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 22:04:55 +02:00
Fix selected pathnames in search results localization issue
Bug introduced by commit: b8224808bd (diff-a6ac7ceba70d88bf1547fd1defd760bd55052dcdb78c44f9d46d99ef1f450472L1722)
Fix by https://github.com/notepad-plus-plus/notepad-plus-plus/issues/15741#issuecomment-2480350071
Close #15813
This commit is contained in:
parent
30e1319ea8
commit
467182602a
@ -1720,9 +1720,9 @@ Find in all files but exclude all folders log or logs recursively:
|
||||
<finder-collapse-all value="Fold all"/>
|
||||
<finder-uncollapse-all value="Unfold all"/>
|
||||
<finder-copy value="Copy Selected Line(s)"/>
|
||||
<finder-copy-paths value="Copy Selected Pathname(s)"/>
|
||||
<finder-copy-selected-paths value="Copy Selected Pathname(s)"/>
|
||||
<finder-clear-all value="Clear all"/>
|
||||
<finder-open-all value="Open Selected Pathname(s)"/>
|
||||
<finder-open-selected-paths value="Open Selected Pathname(s)"/>
|
||||
<finder-purge-for-every-search value="Purge for every search"/>
|
||||
<finder-wrap-long-lines value="Word wrap long lines"/>
|
||||
<common-ok value="OK"/>
|
||||
|
@ -1718,9 +1718,9 @@ Find in all files but exclude all folders log or logs recursively:
|
||||
<finder-collapse-all value="Fold all"/>
|
||||
<finder-uncollapse-all value="Unfold all"/>
|
||||
<finder-copy value="Copy Selected Line(s)"/>
|
||||
<finder-copy-paths value="Copy Selected Pathname(s)"/>
|
||||
<finder-copy-selected-paths value="Copy Selected Pathname(s)"/>
|
||||
<finder-clear-all value="Clear all"/>
|
||||
<finder-open-all value="Open Selected Pathname(s)"/>
|
||||
<finder-open-selected-paths value="Open Selected Pathname(s)"/>
|
||||
<finder-purge-for-every-search value="Purge for every search"/>
|
||||
<finder-wrap-long-lines value="Word wrap long lines"/>
|
||||
<common-ok value="OK"/>
|
||||
|
@ -1396,12 +1396,12 @@ struct HLSColour
|
||||
void loadFromRGB(COLORREF rgb) { ColorRGBToHLS(rgb, &_hue, &_lightness, &_saturation); }
|
||||
COLORREF toRGB() const { return ColorHLSToRGB(_hue, _lightness, _saturation); }
|
||||
|
||||
COLORREF toRGB4DarkModWithTuning(int lightnessMore, int saturationLess) const {
|
||||
COLORREF toRGB4DarkModeWithTuning(int lightnessMore, int saturationLess) const {
|
||||
return ColorHLSToRGB(_hue,
|
||||
static_cast<WORD>(static_cast<int>(_lightness) + lightnessMore),
|
||||
static_cast<WORD>(static_cast<int>(_saturation) - saturationLess));
|
||||
}
|
||||
COLORREF toRGB4DarkMod() const { return toRGB4DarkModWithTuning(50, 20); }
|
||||
COLORREF toRGB4DarkMod() const { return toRGB4DarkModeWithTuning(50, 20); }
|
||||
};
|
||||
|
||||
struct UdlXmlFileState final {
|
||||
|
@ -703,29 +703,33 @@ vector<wstring> Finder::getResultFilePaths(bool onlyInSelectedText) const
|
||||
toLine = _scintView.execute(SCI_GETLINECOUNT) - 1;
|
||||
}
|
||||
|
||||
size_t len = _pMainFoundInfos->size(); // First, get the number of elements in the container
|
||||
for (size_t line = fromLine; line <= toLine; ++line)
|
||||
{
|
||||
bool found = false; // Was it found?
|
||||
const int lineFoldLevel = _scintView.execute(SCI_GETFOLDLEVEL, line) & SC_FOLDLEVELNUMBERMASK;
|
||||
if (lineFoldLevel == fileHeaderLevel)
|
||||
{
|
||||
wstring lineStr = _scintView.getLine(line);
|
||||
|
||||
// fileHeaderLevel line format examples:
|
||||
// spacespaceD:\folder\file.ext (2 hits)
|
||||
// spacespacenew 1 (1 hit)
|
||||
const size_t startIndex = 2; // for number of leading spaces
|
||||
auto endIndex = lineStr.find_last_of(L'(');
|
||||
--endIndex; // adjust for space in front of (
|
||||
wstring path = lineStr.substr(startIndex, endIndex - startIndex);
|
||||
|
||||
// make sure that path is not already in before adding
|
||||
if (std::find(paths.begin(), paths.end(), path) == paths.end())
|
||||
line++; // Move to the next line
|
||||
if (line < len)
|
||||
found = true; // Found it
|
||||
}
|
||||
else if (lineFoldLevel == resultLevel)
|
||||
{
|
||||
if (line < len)
|
||||
found = true; // Found it
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
wstring& path = (*_pMainFoundInfos)[line]._fullPath; // Get the path from the container
|
||||
if (path.find('\\') != std::wstring::npos && std::find(paths.begin(), paths.end(), path) == paths.end()) // Contains a path separator and does not exist in the container
|
||||
{
|
||||
paths.push_back(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
@ -5736,12 +5740,12 @@ intptr_t CALLBACK Finder::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam
|
||||
wstring copyLines = pNativeSpeaker->getLocalizedStrFromID("finder-copy", L"Copy Selected Line(s)");
|
||||
wstring copyVerbatim = pNativeSpeaker->getNativeLangMenuString(IDM_EDIT_COPY, L"Copy", true);
|
||||
copyVerbatim += L"\tCtrl+C";
|
||||
wstring copyPaths = pNativeSpeaker->getLocalizedStrFromID("finder-copy-paths", L"Copy Selected Pathname(s)");
|
||||
wstring copyPaths = pNativeSpeaker->getLocalizedStrFromID("finder-copy-selected-paths", L"Copy Selected Pathname(s)");
|
||||
wstring selectAll = pNativeSpeaker->getNativeLangMenuString(IDM_EDIT_SELECTALL, L"Select all", true);
|
||||
selectAll += L"\tCtrl+A";
|
||||
wstring clearAll = pNativeSpeaker->getLocalizedStrFromID("finder-clear-all", L"Clear all");
|
||||
wstring purgeForEverySearch = pNativeSpeaker->getLocalizedStrFromID("finder-purge-for-every-search", L"Purge for every search");
|
||||
wstring openAll = pNativeSpeaker->getLocalizedStrFromID("finder-open-all", L"Open Selected Pathname(s)");
|
||||
wstring openAll = pNativeSpeaker->getLocalizedStrFromID("finder-open-selected-paths", L"Open Selected Pathname(s)");
|
||||
wstring wrapLongLines = pNativeSpeaker->getLocalizedStrFromID("finder-wrap-long-lines", L"Word wrap long lines");
|
||||
|
||||
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_FINDINFINDERDLG, findInFinder));
|
||||
|
@ -1479,7 +1479,7 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT* pDrawItemStruct, bool isDarkMode)
|
||||
if (_currentHoverTabItem == nTab && brushColour != colorActiveBg) // hover on a "darker" inactive tab
|
||||
{
|
||||
HLSColour hls(brushColour);
|
||||
brushColour = hls.toRGB4DarkModWithTuning(15, 0); // make it lighter slightly
|
||||
brushColour = hls.toRGB4DarkModeWithTuning(15, 0); // make it lighter slightly
|
||||
}
|
||||
|
||||
hBrush = ::CreateSolidBrush(brushColour);
|
||||
|
Loading…
x
Reference in New Issue
Block a user