mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #1252 from RaiKoHoff/Dev_RC
Revert FocusView on closing F/R dialog in any case
This commit is contained in:
commit
d8e97ff462
@ -1 +1 @@
|
||||
1729
|
||||
1731
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<assemblyIdentity
|
||||
name="Notepad3"
|
||||
processorArchitecture="*"
|
||||
version="5.19.526.1729"
|
||||
version="5.19.527.1731"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Notepad3 RC</description>
|
||||
|
||||
19
src/Edit.c
19
src/Edit.c
@ -5256,20 +5256,8 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
Settings.MarkOccurrencesMatchVisible = s_SaveMarkMatchVisible;
|
||||
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_ONOFF, true);
|
||||
|
||||
// check if we had to revert FocusedView
|
||||
if (FocusedView.HideNonMatchedLines) {
|
||||
if (!IsMarkOccurrencesEnabled() ||
|
||||
SciCall_IsSelectionEmpty() ||
|
||||
Settings.MarkOccurrencesMatchVisible ||
|
||||
Settings.MarkOccurrencesCurrentWord ||
|
||||
IsButtonChecked(hwnd, IDC_FINDSTART) ||
|
||||
IsButtonChecked(hwnd, IDC_FINDREGEXP) ||
|
||||
IsButtonChecked(hwnd, IDC_WILDCARDSEARCH) ||
|
||||
(Settings.MarkOccurrencesMatchWholeWords != IsButtonChecked(hwnd, IDC_FINDWORD)) ||
|
||||
(Settings.MarkOccurrencesMatchCase != IsButtonChecked(hwnd, IDC_FINDCASE)))
|
||||
{
|
||||
EditToggleView(sg_pefrData->hwnd);
|
||||
}
|
||||
EditToggleView(sg_pefrData->hwnd);
|
||||
}
|
||||
|
||||
if (IsMarkOccurrencesEnabled()) {
|
||||
@ -6521,7 +6509,8 @@ void EditMarkAll(HWND hwnd, char* pszFind, int flags, DocPos rangeStart, DocPos
|
||||
if (StrIsEmptyA(pszText))
|
||||
{
|
||||
if (SciCall_IsSelectionEmpty()) {
|
||||
if (flags & SCFIND_WHOLEWORD) { // nothing selected, get word under caret if flagged
|
||||
// nothing selected, get word under caret if flagged
|
||||
if (Settings.MarkOccurrencesCurrentWord && (flags & SCFIND_WHOLEWORD)) {
|
||||
DocPos const iCurrPos = SciCall_GetCurrentPos();
|
||||
DocPos const iWordStart = SciCall_WordStartPosition(iCurrPos, true);
|
||||
DocPos const iWordEnd = SciCall_WordEndPosition(iCurrPos, true);
|
||||
@ -6554,7 +6543,7 @@ void EditMarkAll(HWND hwnd, char* pszFind, int flags, DocPos rangeStart, DocPos
|
||||
if (StrChrIA(delims, pszText[iSelStart2])) {
|
||||
return;
|
||||
}
|
||||
iSelStart2++;
|
||||
++iSelStart2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1542,9 +1542,13 @@ static void _InitializeSciEditCtrl(HWND hwndEditCtrl)
|
||||
SendMessage(hwndEditCtrl, SCI_SETSCROLLWIDTH, 1, 0);
|
||||
SendMessage(hwndEditCtrl, SCI_SETSCROLLWIDTHTRACKING, true, 0);
|
||||
SendMessage(hwndEditCtrl, SCI_SETENDATLASTLINE, true, 0);
|
||||
|
||||
SendMessage(hwndEditCtrl, SCI_SETMOUSESELECTIONRECTANGULARSWITCH, true, 0);
|
||||
|
||||
SendMessage(hwndEditCtrl, SCI_SETMULTIPLESELECTION, false, 0);
|
||||
SendMessage(hwndEditCtrl, SCI_SETADDITIONALSELECTIONTYPING, false, 0);
|
||||
SendMessage(hwndEditCtrl, SCI_SETADDITIONALSELECTIONTYPING, true, 0);
|
||||
SendMessage(hwndEditCtrl, SCI_SETMULTIPASTE, true, 0);
|
||||
|
||||
SendMessage(hwndEditCtrl, SCI_SETADDITIONALCARETSBLINK, true, 0);
|
||||
SendMessage(hwndEditCtrl, SCI_SETADDITIONALCARETSVISIBLE, true, 0);
|
||||
|
||||
@ -9527,35 +9531,29 @@ bool RestoreAction(int token, DoAction doAct)
|
||||
// we are inside undo/redo transaction, so do delayed PostMessage() instead of SendMessage()
|
||||
HWND const hwndedit = Globals.hwndEdit;
|
||||
|
||||
DocPos const _anchorPos = (doAct == UNDO ? pSel->anchorPos_undo : pSel->anchorPos_redo);
|
||||
DocPos const _curPos = (doAct == UNDO ? pSel->curPos_undo : pSel->curPos_redo);
|
||||
DocPos const anchorPos = (doAct == UNDO ? pSel->anchorPos_undo : pSel->anchorPos_redo);
|
||||
DocPos const curPos = (doAct == UNDO ? pSel->curPos_undo : pSel->curPos_redo);
|
||||
|
||||
// Ensure that the first and last lines of a selection are always unfolded
|
||||
// This needs to be done _before_ the SCI_SETSEL message
|
||||
DocLn const anchorPosLine = SciCall_LineFromPosition(_anchorPos);
|
||||
DocLn const currPosLine = SciCall_LineFromPosition(_curPos);
|
||||
DocLn const anchorPosLine = SciCall_LineFromPosition(anchorPos);
|
||||
DocLn const currPosLine = SciCall_LineFromPosition(curPos);
|
||||
PostMessage(hwndedit, SCI_ENSUREVISIBLE, anchorPosLine, 0);
|
||||
if (anchorPosLine != currPosLine) { PostMessage(hwndedit, SCI_ENSUREVISIBLE, currPosLine, 0); }
|
||||
|
||||
|
||||
int const selectionMode = (doAct == UNDO ? pSel->selMode_undo : pSel->selMode_redo);
|
||||
PostMessage(hwndedit, SCI_SETSELECTIONMODE, (WPARAM)selectionMode, 0);
|
||||
|
||||
// independent from selection mode
|
||||
PostMessage(hwndedit, SCI_SETANCHOR, (WPARAM)_anchorPos, 0);
|
||||
PostMessage(hwndedit, SCI_SETCURRENTPOS, (WPARAM)_curPos, 0);
|
||||
|
||||
switch (selectionMode)
|
||||
{
|
||||
case SC_SEL_RECTANGLE:
|
||||
PostMessage(hwndedit, SCI_SETRECTANGULARSELECTIONANCHOR, (WPARAM)_anchorPos, 0);
|
||||
PostMessage(hwndedit, SCI_SETRECTANGULARSELECTIONCARET, (WPARAM)_curPos, 0);
|
||||
// fall-through
|
||||
|
||||
case SC_SEL_THIN:
|
||||
case SC_SEL_RECTANGLE:
|
||||
case SC_SEL_THIN:
|
||||
{
|
||||
DocPos const anchorVS = (doAct == UNDO ? pSel->anchorVS_undo : pSel->anchorVS_redo);
|
||||
DocPos const currVS = (doAct == UNDO ? pSel->curVS_undo : pSel->curVS_redo);
|
||||
PostMessage(hwndedit, SCI_SETRECTANGULARSELECTIONANCHOR, (WPARAM)anchorPos, 0);
|
||||
PostMessage(hwndedit, SCI_SETRECTANGULARSELECTIONCARET, (WPARAM)curPos, 0);
|
||||
DocPos const anchorVS = (doAct == UNDO ? pSel->anchorVS_undo : pSel->anchorVS_redo);
|
||||
DocPos const currVS = (doAct == UNDO ? pSel->curVS_undo : pSel->curVS_redo);
|
||||
if ((anchorVS != 0) || (currVS != 0)) {
|
||||
PostMessage(hwndedit, SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, (WPARAM)anchorVS, 0);
|
||||
PostMessage(hwndedit, SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE, (WPARAM)currVS, 0);
|
||||
@ -9563,11 +9561,12 @@ bool RestoreAction(int token, DoAction doAct)
|
||||
}
|
||||
break;
|
||||
|
||||
case SC_SEL_LINES:
|
||||
case SC_SEL_STREAM:
|
||||
default:
|
||||
// nothing to do here
|
||||
break;
|
||||
case SC_SEL_LINES:
|
||||
case SC_SEL_STREAM:
|
||||
default:
|
||||
PostMessage(hwndedit, SCI_SETANCHOR, (WPARAM)anchorPos, 0);
|
||||
PostMessage(hwndedit, SCI_SETCURRENTPOS, (WPARAM)curPos, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
PostMessage(hwndedit, SCI_SCROLLCARET, 0, 0);
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
#define SAPPNAME "Notepad3"
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 19
|
||||
#define VERSION_REV 526
|
||||
#define VERSION_BUILD 1729
|
||||
#define VERSION_REV 527
|
||||
#define VERSION_BUILD 1731
|
||||
#define SCINTILLA_VER 415+
|
||||
#define ONIGMO_REGEX_VER 6.2.0
|
||||
#define VERSION_PATCH RC
|
||||
|
||||
Loading…
Reference in New Issue
Block a user