From 07d5d4be980514fb1435ba1c9dfb6f1d168ba5e4 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 29 Mar 2024 08:12:08 +0800 Subject: [PATCH] minor update --- libs/qsynedit/qsynedit/qsynedit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index e6b808c0..5406d6de 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -287,7 +287,7 @@ int QSynEdit::maxScrollWidth() const { int maxWidth = mDocument->maxLineWidth(); if (maxWidth <= 0) - return INT_MAX; //all inlines invalid. Next paintEvent() will update it. + return maxWidth; //all inlines invalid. Next paintEvent() will update it. if (useCodeFolding()) maxWidth += stringWidth(syntaxer()->foldString(""),maxWidth); if (mOptions.testFlag(eoScrollPastEol)) @@ -3090,6 +3090,8 @@ void QSynEdit::updateHScrollbar() if (mScrollBars == ScrollStyle::ssBoth || mScrollBars == ScrollStyle::ssHorizontal) { nMin = 0; nMax = maxScrollWidth(); + if (nMax<=0) + return; nPage = viewWidth(); nPos = mLeftPos; horizontalScrollBar()->setMinimum(nMin); @@ -3340,8 +3342,8 @@ void QSynEdit::uncollapse(PCodeFoldingRange FoldRange) // Redraw fold mark invalidateGutterLines(FoldRange->fromLine, INT_MAX); - updateVScrollbar(); updateHScrollbar(); + updateVScrollbar(); } void QSynEdit::collapse(PCodeFoldingRange FoldRange)