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

List:       kde-commits
Subject:    KDE/kdelibs/kate/view
From:       Pascal Létourneau <pascal.letourneau () gmail ! com>
Date:       2010-12-02 21:57:58
Message-ID: 20101202215758.AED87AC8A4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1202961 by pletourn:

Revert commit 1202930 
Instead clear the cache earlier

CCBUG:157754


 M  +3 -6      kateviewinternal.cpp  


--- trunk/KDE/kdelibs/kate/view/kateviewinternal.cpp #1202960:1202961
@@ -409,7 +409,7 @@
   {
     KTextEditor::Cursor end(doc()->numVisLines() - 1, \
doc()->lineLength(doc()->getRealLine(doc()->numVisLines() - 1)));  
-    if (m_minLinesVisible)
+    if (m_view->config()->scrollPastEnd())
       m_cachedMaxStartPos = viewLineOffset(end, -m_minLinesVisible);
     else
       m_cachedMaxStartPos = viewLineOffset(end, -(linesDisplayed() - 1));
@@ -653,13 +653,13 @@
 {
   Q_UNUSED(clear_cache)
   kDebug(13030);
+  cache()->clear();
+
   m_cachedMaxStartPos.setLine(-1);
   KTextEditor::Cursor max = maxStartPos();
   if (startPos() > max)
     scrollPos(max);
 
-  cache()->clear ();
-
   m_preserveX = true;
   KTextEditor::Cursor newPos = toRealCursor(toVirtualCursor(m_cursor));
   KateTextLayout newLine = cache()->textLayout(newPos);
@@ -1290,9 +1290,6 @@
   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