[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kate/view
From:       Christoph Cullmann <cullmann () kde ! org>
Date:       2010-12-02 19:49:49
Message-ID: 20101202194949.A52BAAC8A4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1202930 by cullmann:

mwolff:

    Don't crash during code folding when "scroll past end of document" is enabled.
    Generally don't try to pass a zero-offset to viewLineOffset as this will always
    lead to an assert if "dynamic word wrap" is enabled.
    
    Btw.: What m_minLinesVisible should have to do with scrollPastEnd
    is hidden to me - probably a bug and someone wanted to check against
    autoCenterLines but even then m_minLInesVisible is something different.
    
    Add testcase for various configurations, showing that it works fine now.
    
BUG: 157754


 M  +4 -1      kateviewinternal.cpp  


--- trunk/KDE/kdelibs/kate/view/kateviewinternal.cpp #1202929:1202930
@@ -409,7 +409,7 @@
   {
     KTextEditor::Cursor end(doc()->numVisLines() - 1, \
doc()->lineLength(doc()->getRealLine(doc()->numVisLines() - 1)));  
-    if (m_view->config()->scrollPastEnd())
+    if (m_minLinesVisible)
       m_cachedMaxStartPos = viewLineOffset(end, -m_minLinesVisible);
     else
       m_cachedMaxStartPos = viewLineOffset(end, -(linesDisplayed() - 1));
@@ -1290,6 +1290,9 @@
   if (forwards) {
     currentOffset = cache()->lastViewLine(realCursor.line()) - cursorViewLine;
     if (offset <= currentOffset) {
+      // NOTE: if offset is zero the assert below won't hold, see also:
+      // https://bugs.kde.org/show_bug.cgi?id=157754
+      Q_ASSERT(offset);
       // the answer is on the same line
       KateTextLayout thisLine = cache()->textLayout(realCursor.line(), \
cursorViewLine + offset);  Q_ASSERT(thisLine.virtualLine() == virtualCursor.line());


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic