File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4292,6 +4292,7 @@ void QEditor::wheelEvent(QWheelEvent *e)
42924292void QEditor::resizeEvent (QResizeEvent *)
42934293{
42944294 const QSize viewportSize = viewport ()->size ();
4295+ bool cursorIsVisible = isCursorVisible (); // check cursor visibility before changing scrollbars, as it may change after
42954296
42964297 if ( flag (HardLineWrap)||flag (LineWidthConstraint) ){
42974298 horizontalScrollBar ()->setMaximum (qMax (0 , m_LineWidth - viewportSize.width ()));
@@ -4308,11 +4309,11 @@ void QEditor::resizeEvent(QResizeEvent *)
43084309
43094310 setVerticalScrollBarMaximum ();
43104311
4311- emit visibleLinesChanged ();
4312- // qDebug("page step : %i", viewportSize.height() / ls);
4312+ if ( cursorIsVisible && flag (LineWrap) ){
4313+ ensureCursorVisible (KeepDistanceFromViewTop);
4314+ }
43134315
4314- // if ( isCursorVisible() && flag(LineWrap) )
4315- // ensureCursorVisible();
4316+ emit visibleLinesChanged ();
43164317}
43174318
43184319/* !
You can’t perform that action at this time.
0 commit comments