|
|
|
@ -577,10 +577,15 @@ bool Finder::notify(SCNotification *notification)
|
|
|
|
|
case SCN_PAINTED :
|
|
|
|
|
if (isDoubleClicked)
|
|
|
|
|
{
|
|
|
|
|
(*_ppEditView)->getFocus();
|
|
|
|
|
(*_ppEditView)->grabFocus();
|
|
|
|
|
isDoubleClicked = false;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SCN_UPDATEUI:
|
|
|
|
|
::SendMessage(_hParent, NPPM_INTERNAL_CHECKUNDOREDOSTATE, 0, 0);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -698,29 +703,30 @@ 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())
|
|
|
|
|
{
|
|
|
|
|
paths.push_back(path);
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
paths.push_back(path);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return paths;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2352,7 +2358,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
|
|
|
|
|
setStatusbarMessage(result, FSMessage, reasonMsg);
|
|
|
|
|
}
|
|
|
|
|
getFocus();
|
|
|
|
|
grabFocus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
@ -2401,7 +2407,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
if (isMacroRecording)
|
|
|
|
|
saveInMacro(wParam, FR_OP_FIND);
|
|
|
|
|
|
|
|
|
|
getFocus();
|
|
|
|
|
grabFocus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
@ -2451,7 +2457,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
setStatusbarMessage(result, FSMessage, reasonMsg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getFocus();
|
|
|
|
|
grabFocus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
@ -2874,7 +2880,7 @@ bool FindReplaceDlg::processFindNext(const wchar_t *txt2find, const FindOption *
|
|
|
|
|
// if the dialog is not shown, pass the focus to his parent(ie. Notepad++)
|
|
|
|
|
if (!::IsWindowVisible(_hSelf))
|
|
|
|
|
{
|
|
|
|
|
(*_ppEditView)->getFocus();
|
|
|
|
|
(*_ppEditView)->grabFocus();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -3676,7 +3682,7 @@ void FindReplaceDlg::findAllIn(InWhat op)
|
|
|
|
|
{
|
|
|
|
|
// Show finder
|
|
|
|
|
_pFinder->display();
|
|
|
|
|
getFocus(); // no hits
|
|
|
|
|
grabFocus(); // no hits
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else // error - search folder doesn't exist
|
|
|
|
@ -3776,7 +3782,7 @@ Finder * FindReplaceDlg::createFinder()
|
|
|
|
|
|
|
|
|
|
// Show finder
|
|
|
|
|
pFinder->display();
|
|
|
|
|
pFinder->_scintView.getFocus();
|
|
|
|
|
pFinder->_scintView.grabFocus();
|
|
|
|
|
|
|
|
|
|
return pFinder;
|
|
|
|
|
}
|
|
|
|
@ -5731,12 +5737,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));
|
|
|
|
@ -5905,7 +5911,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
|
|
|
|
|
{
|
|
|
|
|
case IDCANCEL :
|
|
|
|
|
(*(_pFRDlg->_ppEditView))->clearIndicator(SCE_UNIVERSAL_FOUND_STYLE_INC);
|
|
|
|
|
(*(_pFRDlg->_ppEditView))->getFocus();
|
|
|
|
|
(*(_pFRDlg->_ppEditView))->grabFocus();
|
|
|
|
|
display(false);
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
|
|