fix: scroll to last line
This commit is contained in:
parent
79274d786a
commit
67f9cbe6ee
|
@ -3110,7 +3110,7 @@ void QSynEdit::updateHScrollbar()
|
||||||
}
|
}
|
||||||
if (mScrollBars == ScrollStyle::ssBoth || mScrollBars == ScrollStyle::ssHorizontal) {
|
if (mScrollBars == ScrollStyle::ssBoth || mScrollBars == ScrollStyle::ssHorizontal) {
|
||||||
nMaxScroll = maxScrollWidth();
|
nMaxScroll = maxScrollWidth();
|
||||||
nMin = 1;
|
nMin = 0;
|
||||||
nMax = nMaxScroll;
|
nMax = nMaxScroll;
|
||||||
nPage = viewWidth();
|
nPage = viewWidth();
|
||||||
nPos = mLeftPos;
|
nPos = mLeftPos;
|
||||||
|
@ -3144,7 +3144,7 @@ void QSynEdit::updateVScrollbar()
|
||||||
|
|
||||||
if (mScrollBars == ScrollStyle::ssBoth || mScrollBars == ScrollStyle::ssVertical) {
|
if (mScrollBars == ScrollStyle::ssBoth || mScrollBars == ScrollStyle::ssVertical) {
|
||||||
nMaxScroll = maxScrollHeight();
|
nMaxScroll = maxScrollHeight();
|
||||||
nMin = 1;
|
nMin = 0;
|
||||||
nMax = std::max(1, nMaxScroll);
|
nMax = std::max(1, nMaxScroll);
|
||||||
nPage = mLinesInWindow;
|
nPage = mLinesInWindow;
|
||||||
nPos = mTopPos;
|
nPos = mTopPos;
|
||||||
|
@ -6458,9 +6458,9 @@ void QSynEdit::dragLeaveEvent(QDragLeaveEvent *)
|
||||||
int QSynEdit::maxScrollHeight() const
|
int QSynEdit::maxScrollHeight() const
|
||||||
{
|
{
|
||||||
if (mOptions.testFlag(eoScrollPastEof))
|
if (mOptions.testFlag(eoScrollPastEof))
|
||||||
return std::max(displayLineCount(),1) * mTextHeight - 1;
|
return (std::max(displayLineCount(),1) - 1) * mTextHeight;
|
||||||
else
|
else
|
||||||
return std::max((displayLineCount()-mLinesInWindow+1) * mTextHeight - 1 , 1) ;
|
return std::max((displayLineCount()-mLinesInWindow+1) * mTextHeight, 1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QSynEdit::modified() const
|
bool QSynEdit::modified() const
|
||||||
|
|
Loading…
Reference in New Issue