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

List:       kde-commits
Subject:    [kate] part/document: fixup highlighted line max counter
From:       Christoph Cullmann <cullmann () kde ! org>
Date:       2012-10-26 23:24:56
Message-ID: 20121026232456.41990A6078 () git ! kde ! org
[Download RAW message or body]

Git commit 9485dbefc8836ab37f4d7e3170eb3769e7c0d349 by Christoph Cullmann.
Committed on 27/10/2012 at 01:24.
Pushed by cullmann into branch 'master'.

fixup highlighted line max counter

M  +10   -5    part/document/katebuffer.cpp

http://commits.kde.org/kate/9485dbefc8836ab37f4d7e3170eb3769e7c0d349

diff --git a/part/document/katebuffer.cpp b/part/document/katebuffer.cpp
index e9411c6..79732a8 100644
--- a/part/document/katebuffer.cpp
+++ b/part/document/katebuffer.cpp
@@ -270,20 +270,25 @@ void KateBuffer::unwrapLines (int from, int to)
   Q_ASSERT(to + 1 <= lines());
 
   for (int line = to; line >= from; --line) {
-      if (line + 1 < lines())
+      if (line + 1 < lines()) {
           Kate::TextBuffer::unwrapLine (line + 1);
+        
+          if (m_lineHighlighted > (line + 1))
+            --m_lineHighlighted;
+      }
 
       // Line "0" can't be unwraped
       // This call is used to unwrap the last line (if last line != 0)
       // This call was used in the previous version too and it looks like the last
       // line can't be unwraped without it
-      else if (line)
+      else if (line) {
           Kate::TextBuffer::unwrapLine (line);
+        
+          if (m_lineHighlighted > line)
+            --m_lineHighlighted;
+      }
   }
 
-  if (m_lineHighlighted > from)
-    m_lineHighlighted = from;
-
   m_regionTree.linesHaveBeenRemoved (from, to);
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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