Bug 96605 - History 'Number of Lines' - 1 is viewable
Summary: History 'Number of Lines' - 1 is viewable
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-08 23:01 UTC by Kurt Hindenburg
Modified: 2007-01-12 20:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Moderate changes to HistoryScrollBuffer, should fix problems (4.65 KB, patch)
2007-01-07 01:27 UTC, Tom
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Hindenburg 2005-01-08 23:01:48 UTC
Version:            (using KDE Devel)

While working on the crash BR95990, I noticed this.

Setting the 'Number of Lines' to 1, gives no History.
Setting to 2, give 1 line of History.
... etc... etc...


This appears to fix it.

--- TEHistory.cpp       28 Jun 2003 10:31:38 -0000      1.25
+++ TEHistory.cpp       8 Jan 2005 19:27:04 -0000
 @ -230,7 +230,7  @ void HistoryScrollBuffer::addCells(ca a[
      m_buffFilled = true;
     }

-  if (m_nbLines < m_maxNbLines - 1) ++m_nbLines;
+  if (m_nbLines < m_maxNbLines) ++m_nbLines;

   // m_histBuffer.remove(m_arrayIndex); // not necessary
   m_histBuffer.insert(m_arrayIndex, newLine);
Comment 1 Kurt Hindenburg 2005-01-09 08:53:37 UTC
CVS commit by hindenburg: 

Correct # of history lines that are viewable.

BUG: 96605


  M +1 -1      TEHistory.cpp   1.28


--- kdebase/konsole/konsole/TEHistory.cpp  #1.27:1.28
@@ -231,5 +231,5 @@ void HistoryScrollBuffer::addCells(ca a[
     }
 
-  if (m_nbLines < m_maxNbLines - 1) ++m_nbLines;
+  if (m_nbLines < m_maxNbLines) ++m_nbLines;
 
   // m_histBuffer.remove(m_arrayIndex); // not necessary


Comment 2 Kurt Hindenburg 2005-01-14 08:27:18 UTC
I may end up reverting this for 3.4.  It appears to have some side-effects.  And this bug shouldn't affect many people.
Comment 3 Kurt Hindenburg 2005-01-14 16:44:48 UTC
CVS commit by hindenburg: 

Revert my earlier patch.

CCMAIL: 96605@bugs.kde.org


  M +2 -1      TEHistory.cpp   1.29


--- kdebase/konsole/konsole/TEHistory.cpp  #1.28:1.29
@@ -231,5 +231,6 @@ void HistoryScrollBuffer::addCells(ca a[
     }
 
-  if (m_nbLines < m_maxNbLines) ++m_nbLines;
+  // FIXME: See BR96605
+  if (m_nbLines < m_maxNbLines - 1) ++m_nbLines;
 
   // m_histBuffer.remove(m_arrayIndex); // not necessary


Comment 4 Tom 2007-01-07 01:24:54 UTC
It seems ScrollHistoryBuffer was full of strangeness and one-off errors.  I believe I have a fix; I'll attach my patch (against kdebase-3.5.5).  I've tested it for a half-hour or so, and I don't see any more weirdness when resizing the history.

Valgrind reports no memory problems (of mine), though when shrinking the history buffer, I don't see the VmSize decrease.  I blame heap fragmentation.
Comment 5 Tom 2007-01-07 01:27:11 UTC
Created attachment 19143 [details]
Moderate changes to HistoryScrollBuffer, should fix problems
Comment 6 Robert Knight 2007-01-12 20:19:12 UTC
Thanks for your patch Tom, I have checked and committed it.