- change: Ensure the line just below caret is visible while moving caret.
This commit is contained in:
parent
7b9c5b378a
commit
00736ea73b
1
NEWS.md
1
NEWS.md
|
@ -12,6 +12,7 @@ Red Panda C++ Version 2.26
|
|||
- fix: Link in the project options dialog / precompiled header pages is not clickable.
|
||||
- change: Don't change caret position when ctrl+click.
|
||||
- fix: Should cd to working directory when debugging.
|
||||
- change: Ensure the line just below caret is visible while moving caret.
|
||||
|
||||
Red Panda C++ Version 2.25
|
||||
|
||||
|
|
|
@ -1373,6 +1373,7 @@ void Editor::mouseReleaseEvent(QMouseEvent *event)
|
|||
QString filename = mParser->getHeaderFileName(mFilename,s);
|
||||
pMainWindow->openFile(filename);
|
||||
return;
|
||||
|
||||
} else if (mParser->enabled()) {
|
||||
gotoDefinition(p);
|
||||
return;
|
||||
|
|
|
@ -3043,14 +3043,14 @@ void QSynEdit::ensureCursorPosVisibleEx(bool ForceToMiddle)
|
|||
// Make sure Y is visible
|
||||
int vCaretRow = displayY();
|
||||
if (ForceToMiddle) {
|
||||
if (vCaretRow < mTopLine || vCaretRow>(mTopLine + (mLinesInWindow - 1)))
|
||||
if (vCaretRow < mTopLine || vCaretRow>(mTopLine + (mLinesInWindow - 2)))
|
||||
setTopLine( vCaretRow - (mLinesInWindow - 1) / 2);
|
||||
} else {
|
||||
if (vCaretRow < mTopLine)
|
||||
setTopLine(vCaretRow);
|
||||
else if (vCaretRow > mTopLine + (mLinesInWindow - 1) && mLinesInWindow > 0)
|
||||
setTopLine(vCaretRow - (mLinesInWindow - 1));
|
||||
else
|
||||
else if (vCaretRow > mTopLine + (mLinesInWindow - 2) && mLinesInWindow > 2) {
|
||||
setTopLine(vCaretRow - (mLinesInWindow - 2) );
|
||||
} else
|
||||
setTopLine(mTopLine);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue