mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
Merge remote-tracking branch 'upstream/Hotfix_REL_5204112' into NewFeatures_grepWinNP3
# Conflicts: # src/Edit.c # src/Notepad3.c
This commit is contained in:
commit
70023d52a2
16
src/Edit.c
16
src/Edit.c
@ -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();
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user