+ chg: revert FocusView on closing F/R dialog in any case

This commit is contained in:
Rainer Kottenhoff 2019-05-27 00:04:19 +02:00
parent 267f1f4784
commit b5fdff3e16
5 changed files with 25 additions and 38 deletions

View File

@ -1 +1 @@
1729
1730

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.19.526.1729"
version="5.19.526.1730"
type="win32"
/>
<description>Notepad3 RC</description>

View File

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

View File

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

View File

@ -8,7 +8,7 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 19
#define VERSION_REV 526
#define VERSION_BUILD 1729
#define VERSION_BUILD 1730
#define SCINTILLA_VER 415+
#define ONIGMO_REGEX_VER 6.2.0
#define VERSION_PATCH RC