Merge pull request #2543 from RaiKoHoff/Dev_Release

Move view to matching brace (even if outside current work area)
This commit is contained in:
Rainer Kottenhoff 2020-07-20 15:46:10 +02:00 committed by GitHub
commit 9624104f70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 14 deletions

View File

@ -2137,10 +2137,8 @@ void EditFindMatchingBrace()
}
if (iMatchingBracePos != (DocPos)-1) {
iMatchingBracePos = bIsAfter ? iMatchingBracePos : SciCall_PositionAfter(iMatchingBracePos);
_BEGIN_UNDO_ACTION_;
SciCall_GotoPos(iMatchingBracePos);
Sci_ScrollToCurrentLine();
_END_UNDO_ACTION_;
SciCall_ChooseCaretX();
}
}
@ -3082,7 +3080,7 @@ void EditIndentBlock(HWND hwnd, int cmd, bool bFormatIndentation, bool bForceAll
}
else {
SciCall_GotoPos(iInitialPos);
Sci_ScrollToCurrentLine();
SciCall_ChooseCaretX();
}
_END_UNDO_ACTION_;
@ -5066,6 +5064,7 @@ void EditJumpTo(DocLn iNewLine, DocPos iNewCol)
const DocPos iNewPos = SciCall_FindColumn(iNewLine, iNewCol);
SciCall_GotoPos(iNewPos);
SciCall_ChooseCaretX();
}

View File

@ -2558,7 +2558,7 @@ LRESULT MsgDPIChanged(HWND hwnd, WPARAM wParam, LPARAM lParam)
MsgThemeChanged(hwnd, wParam, lParam);
SciCall_GotoPos(pos);
Sci_ScrollToCurrentLine();
SciCall_ChooseCaretX();
return !0;
}
@ -3018,7 +3018,7 @@ LRESULT MsgChangeNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
else {
SciCall_GotoPos(iCurPos);
Sci_ScrollToCurrentLine();
SciCall_ChooseCaretX();
}
}
}
@ -5595,16 +5595,15 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
SciCall_SetIndicatorCurrent(INDIC_NP3_MULTI_EDIT);
SciCall_IndicatorClearRange(0, Sci_GetDocEndPosition());
SciCall_ClearSelections();
SciCall_GotoPos(iCurPos);
_END_UNDO_ACTION_;
SciCall_GotoPos(iCurPos);
s_bInMultiEditMode = false;
--skipLevel;
}
if ((!SciCall_IsSelectionEmpty() || Sci_IsMultiOrRectangleSelection()) && (skipLevel == Settings2.ExitOnESCSkipLevel)) {
_BEGIN_UNDO_ACTION_;
SciCall_GotoPos(iCurPos);
_END_UNDO_ACTION_;
SciCall_ChooseCaretX();
skipLevel -= Defaults2.ExitOnESCSkipLevel;
}
@ -5620,9 +5619,8 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
break;
default:
_BEGIN_UNDO_ACTION_;
SciCall_GotoPos(iCurPos);
_END_UNDO_ACTION_;
SciCall_ChooseCaretX();
break;
}
}
@ -9527,10 +9525,8 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload,
}
if (bReload && !FileWatching.MonitoringLog)
{
_BEGIN_UNDO_ACTION_;
SciCall_GotoPos(0);
Sci_ScrollToCurrentLine();
_END_UNDO_ACTION_;
SciCall_ChooseCaretX();
_BEGIN_UNDO_ACTION_;
fSuccess = FileIO(true, szFilePath, bSkipUnicodeDetect, bSkipANSICPDetection, bForceEncDetection, !bReload , &fioStatus, false, false);
@ -9548,6 +9544,7 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload,
BeginWaitCursor(true, L"Styling...");
SciCall_GotoPos(0);
SciCall_ChooseCaretX();
if (!s_IsThisAnElevatedRelaunch) {
Flags.bPreserveFileModTime = DefaultFlags.bPreserveFileModTime;