Merge branch 'master' into features/update-serbian

pull/15696/head
Radoš Milićev 6 days ago
commit f09505d99c

@ -1484,7 +1484,6 @@ Updated to v8.2.1:
<find-result-title-info-selections value="($INT_REPLACE1$ аиқәшәарақәа $INT_REPLACE2$ аҟны иалкаақәоу $INT_REPLACE3$ рҟынтәи)"/>
<find-result-title-info-extra value=" - Ацәаҳәақәа рФильтр Арежим: иаанарԥшуеит афильтрра алҵшәақәа мацара"/>
<find-result-hits value="(Аиқәшәарақәа $INT_REPLACE$)"/>
<find-result-hits-and-line-hits value="($INT_REPLACE1$ аиқәшәарақәа ацәаҳәақәа $INT_REPLACE2$ рҟны)"/>
<find-regex-zero-length-match value="ноль аура змоу аиқәшәара"/>
<session-save-folder-as-workspace value="Еиқәырхатәуп Акаталог Апроект ҳасабла"/>
<tab-untitled-string value="аҿыц "/>

@ -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"/>

@ -1762,7 +1762,6 @@ Notepad++ сделает резервную копию вашего старог
<find-result-title-info-selections value="(найдено $INT_REPLACE1$ совпадений в $INT_REPLACE2$ выделениях из $INT_REPLACE3$)"/>
<find-result-title-info-extra value=" - Режим Фильтрации Строк: только отображает результаты фильтрования"/>
<find-result-hits value="(совпадений: $INT_REPLACE$)"/>
<find-result-hits-and-line-hits value="($INT_REPLACE1$ совпадений в $INT_REPLACE2$ строках)"/>
<find-regex-zero-length-match value="совпадение нулевой длины"/>
<session-save-folder-as-workspace value="Сохранить Папку как Проект"/>
<tab-untitled-string value="новый "/>

@ -880,7 +880,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
activateBuffer(_mainEditView.getCurrentBufferID(), MAIN_VIEW);
activateBuffer(_subEditView.getCurrentBufferID(), SUB_VIEW);
_mainEditView.getFocus();
_mainEditView.grabFocus();
return TRUE;
}
@ -2566,7 +2566,20 @@ void Notepad_plus::checkClipboard()
if (!NppParameters::getInstance().getSVP()._lineCopyCutWithoutSelection)
{
enableCommand(IDM_EDIT_CUT, hasSelection, MENU | TOOLBAR);
enableCommand(IDM_EDIT_COPY, hasSelection, MENU | TOOLBAR);
if (hasSelection)
{
enableCommand(IDM_EDIT_COPY, true, MENU | TOOLBAR);
}
else if (_findReplaceDlg.allowCopyAction())
{
enableCommand(IDM_EDIT_COPY, false, TOOLBAR);
enableCommand(IDM_EDIT_COPY, true, MENU);
}
else
{
enableCommand(IDM_EDIT_COPY, false, MENU | TOOLBAR);
}
}
enableCommand(IDM_EDIT_PASTE, canPaste, MENU | TOOLBAR);
enableCommand(IDM_EDIT_DELETE, hasSelection, MENU | TOOLBAR);
@ -4752,7 +4765,7 @@ int Notepad_plus::switchEditViewTo(int gid)
if (currentView() == gid)
{
//make sure focus is ok, then leave
_pEditView->getFocus(); //set the focus
_pEditView->grabFocus(); //set the focus
return gid;
}
@ -4768,7 +4781,7 @@ int Notepad_plus::switchEditViewTo(int gid)
std::swap(_pEditView, _pNonEditView);
_pEditView->beSwitched();
_pEditView->getFocus(); //set the focus
_pEditView->grabFocus(); //set the focus
if (_pDocMap)
{
@ -5939,7 +5952,7 @@ void Notepad_plus::fullScreenToggle()
int y = nppRect.top;
::MoveWindow(_restoreButton.getHSelf(), x, y, w, h, FALSE);
_pEditView->getFocus();
_pEditView->grabFocus();
}
else //toggle fullscreen off
{
@ -6073,7 +6086,7 @@ void Notepad_plus::postItToggle()
int y = nppRect.top + 1;
::MoveWindow(_restoreButton.getHSelf(), x, y, w, h, FALSE);
_pEditView->getFocus();
_pEditView->grabFocus();
}
else //PostIt enabled, disable it
{
@ -7697,7 +7710,7 @@ void Notepad_plus::launchDocMap()
_pDocMap->wrapMap();
_pDocMap->display();
_pEditView->getFocus();
_pEditView->grabFocus();
}

@ -2257,7 +2257,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
if (wParam != WA_INACTIVE && _pEditView && _pNonEditView)
{
_pEditView->getFocus();
_pEditView->grabFocus();
auto x = _pEditView->execute(SCI_GETXOFFSET);
_pEditView->execute(SCI_SETXOFFSET, x);
x = _pNonEditView->execute(SCI_GETXOFFSET);
@ -2880,7 +2880,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
//case WM_LBUTTONDBLCLK:
case WM_LBUTTONUP :
{
_pEditView->getFocus();
_pEditView->grabFocus();
::ShowWindow(hwnd, SW_SHOW);
_dockingManager.showFloatingContainers(true);
restoreMinimizeDialogs();

@ -895,7 +895,7 @@ void Notepad_plus::command(int id)
{
if (_pDocumentListPanel && _pDocumentListPanel->isVisible())
{
_pDocumentListPanel->getFocus();
_pDocumentListPanel->grabFocus();
}
else
{
@ -1035,7 +1035,7 @@ void Notepad_plus::command(int id)
{
if (_pFuncList && _pFuncList->isVisible())
{
_pFuncList->getFocus();
_pFuncList->grabFocus();
}
else
{

@ -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 {

@ -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;

@ -352,10 +352,21 @@ public :
if (_pFinder)
{
_pFinder->display();
_pFinder->_scintView.getFocus();
_pFinder->_scintView.grabFocus();
}
};
bool allowCopyAction() {
HWND focusedHwnd = GetFocus();
Finder* finder = getFinderFrom(focusedHwnd);
if (finder)
{
return finder->_scintView.hasSelection();
}
return false;
};
HWND getHFindResults() {
if (_pFinder)
return _pFinder->_scintView.getHSelf();

@ -118,7 +118,7 @@ intptr_t CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
notification.nmhdr.idFrom = ::GetDlgCtrlID(_hSelf);
::SendMessage(_hParent, WM_NOTIFY, LINKTRIGGERED, reinterpret_cast<LPARAM>(&notification));
(*_ppEditView)->getFocus();
(*_ppEditView)->grabFocus();
return TRUE;
}

@ -353,7 +353,7 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
}
}
(*_ppEditView)->execute(SCI_ENDUNDOACTION);
(*_ppEditView)->getFocus();
(*_ppEditView)->grabFocus();
return TRUE;
}
case IDC_COL_TEXT_RADIO :

@ -176,7 +176,7 @@ void AnsiCharPanel::insertChar(unsigned char char2insert) const
(*_ppEditView)->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
size_t len = (char2insert < 128) ? 1 : strlen(multiByteStr);
(*_ppEditView)->execute(SCI_ADDTEXT, len, reinterpret_cast<LPARAM>(multiByteStr));
(*_ppEditView)->getFocus();
(*_ppEditView)->grabFocus();
}
void AnsiCharPanel::insertString(LPWSTR string2insert) const
@ -203,5 +203,5 @@ void AnsiCharPanel::insertString(LPWSTR string2insert) const
(*_ppEditView)->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
size_t len = strlen(multiByteStr);
(*_ppEditView)->execute(SCI_ADDTEXT, len, reinterpret_cast<LPARAM>(multiByteStr));
(*_ppEditView)->getFocus();
(*_ppEditView)->grabFocus();
}

@ -287,7 +287,7 @@ intptr_t CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam
(*_ppEditView)->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
(*_ppEditView)->execute(SCI_ADDTEXT, strlen(c), reinterpret_cast<LPARAM>(c));
(*_ppEditView)->getFocus();
(*_ppEditView)->grabFocus();
delete[] c;
}
}

@ -1008,7 +1008,7 @@ bool WordStyleDlg::goToSection(const wchar_t* sectionNames)
::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_SETCURSEL, i, 0);
setVisualFromStyleList();
getFocus();
grabFocus();
return true;
}

@ -449,7 +449,7 @@ bool FileBrowser::selectItemFromPath(const wstring& itemPath) const
if (foundItem)
{
_treeView.selectItem(foundItem);
_treeView.getFocus();
_treeView.grabFocus();
return true;
}
}

@ -104,7 +104,7 @@ bool PreferenceDlg::goToSection(size_t iPage, intptr_t ctrlID)
{
::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_SETCURSEL, iPage, 0);
showDialogByIndex(iPage);
getFocus();
grabFocus();
if (ctrlID != -1)
{
@ -2047,7 +2047,7 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
}
NppDarkMode::refreshDarkMode(_hSelf, forceRefresh);
getFocus(); // to make black mode title bar appear
grabFocus(); // to make black mode title bar appear
return TRUE;
}

@ -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);

@ -29,61 +29,52 @@ public:
//@}
virtual void init(HINSTANCE hInst, HWND parent)
{
virtual void init(HINSTANCE hInst, HWND parent) {
_hInst = hInst;
_hParent = parent;
}
virtual void destroy() = 0;
virtual void display(bool toShow = true) const
{
virtual void display(bool toShow = true) const {
::ShowWindow(_hSelf, toShow ? SW_SHOW : SW_HIDE);
}
virtual void reSizeTo(RECT & rc) // should NEVER be const !!!
{
virtual void reSizeTo(RECT & rc) { // should NEVER be const !!!
::MoveWindow(_hSelf, rc.left, rc.top, rc.right, rc.bottom, TRUE);
redraw();
}
virtual void reSizeToWH(RECT& rc) // should NEVER be const !!!
{
virtual void reSizeToWH(RECT& rc) { // should NEVER be const !!!
::MoveWindow(_hSelf, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
redraw();
}
virtual void redraw(bool forceUpdate = false) const
{
virtual void redraw(bool forceUpdate = false) const {
::InvalidateRect(_hSelf, nullptr, TRUE);
if (forceUpdate)
::UpdateWindow(_hSelf);
}
virtual void getClientRect(RECT & rc) const
{
virtual void getClientRect(RECT & rc) const {
::GetClientRect(_hSelf, &rc);
}
virtual void getWindowRect(RECT & rc) const
{
virtual void getWindowRect(RECT & rc) const {
::GetWindowRect(_hSelf, &rc);
}
virtual int getWidth() const
{
virtual int getWidth() const {
RECT rc;
::GetClientRect(_hSelf, &rc);
return (rc.right - rc.left);
}
virtual int getHeight() const
{
virtual int getHeight() const {
RECT rc;
::GetClientRect(_hSelf, &rc);
if (::IsWindowVisible(_hSelf) == TRUE)
@ -96,8 +87,7 @@ public:
return (::IsWindowVisible(_hSelf)?true:false);
}
HWND getHSelf() const
{
HWND getHSelf() const {
return _hSelf;
}
@ -105,13 +95,11 @@ public:
return _hParent;
}
void getFocus() const {
void grabFocus() const {
::SetFocus(_hSelf);
}
HINSTANCE getHinst() const
{
//assert(_hInst != 0);
HINSTANCE getHinst() const {
return _hInst;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 174 B

Loading…
Cancel
Save