Merge remote-tracking branch 'upstream/Hotfix_REL_5204112' into NewFeatures_grepWinNP3

# Conflicts:
#	src/Edit.c
#	src/Notepad3.c
This commit is contained in:
RaiKoHoff 2020-04-14 12:38:42 +02:00
commit 70023d52a2
2 changed files with 8 additions and 16 deletions

View File

@ -4976,12 +4976,12 @@ void EditSetSelectionEx(DocPos iAnchorPos, DocPos iCurrentPos, DocPos vSpcAnchor
if (vSpcCurrent > 0) {
SciCall_SetRectangularSelectionCaretVirtualSpace(vSpcCurrent);
}
EditEnsureSelectionVisible();
}
else {
SciCall_SetSel(iAnchorPos, iCurrentPos); // scrolls into view
SciCall_ChooseCaretX();
}
//~EditNormalizeView(Sci_GetCurrentLineNumber()); // normalize view
EditEnsureSelectionVisible();
}
//~~~_END_UNDO_ACTION_;~~~
@ -5022,17 +5022,11 @@ void EditNormalizeView(const DocLn iDocLine)
//
void EditEnsureSelectionVisible()
{
DocPos const posCurrent = SciCall_GetCurrentPos();
DocPos const posAnchor = SciCall_GetAnchor();
DocLn const iCurrentLine = SciCall_LineFromPosition(posCurrent);
DocLn const iAnchorLine = SciCall_LineFromPosition(posAnchor);
// 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 iCurrentLine = SciCall_LineFromPosition(SciCall_GetCurrentPos());
DocLn const iAnchorLine = SciCall_LineFromPosition(SciCall_GetAnchor());
SciCall_EnsureVisible(iAnchorLine);
if (iAnchorLine != iCurrentLine) { SciCall_EnsureVisible(iCurrentLine); }
SciCall_ScrollRange(posCurrent, posAnchor);
Sci_ScrollToLine(iCurrentLine);
Sci_ScrollChooseCaret();
}

View File

@ -4885,7 +4885,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
DocPosU const iNewMain = SciCall_GetSelections() - 1;
SciCall_SetMainSelection(iNewMain);
}
//EditNormalizeView(Sci_GetCurrentLineNumber()); // normalize view
//~EditNormalizeView(Sci_GetCurrentLineNumber());
EditEnsureSelectionVisible();
}
break;
@ -5304,7 +5304,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
FileWatching.AutoReloadTimeout = Settings2.AutoReloadTimeout;
UndoRedoRecordingStart();
SciCall_SetEndAtLastLine(!Settings.ScrollPastEOF);
EditNormalizeView(Sci_GetCurrentLineNumber()); // normalize view
EditNormalizeView(Sci_GetCurrentLineNumber());
}
InstallFileWatching(Globals.CurrentFile); // force
@ -9517,9 +9517,7 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload,
// set historic caret/selection pos
else if ((iCaretPos >= 0) && (iAnchorPos >= 0))
{
SciCall_SetSel(iAnchorPos, iCaretPos); // scroll into view
//~EditNormalizeView(Sci_GetCurrentLineNumber());
EditEnsureSelectionVisible();
EditSetSelectionEx(iAnchorPos, iCaretPos, 0, 0);
}
}