Bug 118584

Summary: scroll position not upgrading
Product: [Applications] kate Reporter: Becheru Petru-Ioan <becheru.petru.ioan>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Becheru Petru-Ioan 2005-12-18 18:59:42 UTC
Version:           unknown (using KDE 3.5.0, Debian Package 4:3.5.0-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.8-2-386

open a document that will activate scrollbar(this means that the file has more lines than the editor can show so it will use a scrollbar). Move the cursor to an upper line(first, second ,third). Use "scroll line down" (sc:Control + Down Arrow) until bottom.now use arrows and move the cursor 1 position(just one keypress!). The cursor is shown where it suppose it would be (in the upper lines) BUT the scrollbar is still down. U can move in the view left /right without scrollbar to move from bottom. If u go upper than first line shown or lower than last line shown the scrollbar will be in the right position again.
Notes:
- it works only when u "scroll line down" until end
- possible bug fix tip : update scrollbar position everytime the cursor moves or see what happens when it reaches bottom
Comment 1 Anders Lund 2005-12-18 19:40:51 UTC
On Sunday 18 December 2005 18:59, zvonSully wrote:
> Summary: scroll position not upgrading


Following the instruction, everything works correctly here.

-anders
Comment 2 Becheru Petru-Ioan 2005-12-23 23:26:59 UTC
Sorry for my English :
-"Move the cursor to an upper line(first, second ,third)" should be "Move the cursor to an upper line(first, second  OR third LINE)"
-"now use arrows" should be "now use LEFT or RIGHT arrows"
Here is the new text:
Open a document that will activate scrollbar(this means that the file has more lines than the editor can show so it will use a scrollbar). Move the cursor to an upper line(first, second OR third LINE). Use "scroll line down" (sc:Control + Down Arrow) until bottom. Now use RIGHT or LEFT arrows and move the cursor 1 position(just one keypress!)(BEWARE TO MOVE THE CURSOR SO IT DOES NOT GO TO ANOTHER LINE (KEEP ON THE SAME LINE) ). The cursor is shown where it suppose it would be (in the upper lines) but the scrollbar is still down. U can move in the view left /right without scrollbar to move from bottom. If u go upper than first line shown or lower than last line shown the scrollbar will be in the right position again. 
 
Comment 3 Dominik Huber 2006-01-02 17:47:00 UTC
I can confirm this behavior.
Comment 4 Dominik Huber 2006-01-02 17:51:30 UTC
- Open a document that has so much text that the scrollbar appears
- Go with the cursor into the first line
- Press "Ctrl + down arrow" until you are at the end of the page
- Press left or right arrow

---> The scrollbar stays at the botton, but the view is again in the first line.
Comment 5 Andreas Kling 2006-06-26 12:45:01 UTC
SVN commit 555118 by kling:

Removed an old artifact that caused scrollbar flakiness when moving the cursor
while the view is scrolled to the very bottom and dynamic word-wrap is on.

BUG: 118584


 M  +1 -10     kateviewinternal.cpp  
 M  +0 -4      kateviewinternal.h  


--- branches/KDE/3.5/kdelibs/kate/part/kateviewinternal.cpp #555117:555118
@@ -76,7 +76,6 @@
   , m_scrollTimer (this)
   , m_cursorTimer (this)
   , m_textHintTimer (this)
-  , m_maximizeLineScroll (false)
   , m_textHintEnabled(false)
   , m_textHintMouseX(-1)
   , m_textHintMouseY(-1)
@@ -390,9 +389,6 @@
   if (c > limit) {
     c = limit;
 
-    if (m_view->dynWordWrap())
-      m_maximizeLineScroll = true;
-
     // Re-check we're not just scrolling to the same place
     if (!force && ((!m_view->dynWordWrap() && c.line() == (int)startLine()) || c == startPos()))
       return;
@@ -487,12 +483,7 @@
     maxLineScrollRange++;
   m_lineScroll->setRange(0, maxLineScrollRange);
 
-  if (m_view->dynWordWrap() && m_maximizeLineScroll) {
-    m_maximizeLineScroll = false;
-    m_lineScroll->setValue(maxStart.line());
-  } else {
-    m_lineScroll->setValue(startPos().line());
-  }
+  m_lineScroll->setValue(startPos().line());
   m_lineScroll->setSteps(1, height() / m_view->renderer()->fontHeight());
   m_lineScroll->blockSignals(false);
 
--- branches/KDE/3.5/kdelibs/kate/part/kateviewinternal.h #555117:555118
@@ -362,10 +362,6 @@
     static const int scrollTime = 30;
     static const int scrollMargin = 16;
 
-    // dyn wrap mode:
-    // used to set the lineScroll to the max value
-    bool m_maximizeLineScroll;
-
   private slots:
     void scrollTimeout ();
     void cursorTimeout ();
Comment 6 Andreas Kling 2006-06-26 12:47:06 UTC
SVN commit 555120 by kling:

Forward-port SVN commit 555118 by kling: 
 
Removed an old artifact that caused scrollbar flakiness when moving the cursor 
while the view is scrolled to the very bottom and dynamic word-wrap is on. 
    
CCBUG: 118584 


 M  +1 -12     kateviewinternal.cpp  
 M  +0 -4      kateviewinternal.h  


--- trunk/KDE/kdelibs/kate/part/kateviewinternal.cpp #555119:555120
@@ -84,7 +84,6 @@
   , m_scrollTimer (this)
   , m_cursorTimer (this)
   , m_textHintTimer (this)
-  , m_maximizeLineScroll(false)
   , m_textHintEnabled(false)
   , m_textHintMouseX(-1)
   , m_textHintMouseY(-1)
@@ -440,11 +439,6 @@
   if (c > limit) {
     c = limit;
 
-    // overloading this variable, it's not used in non-word wrap
-    // used to set the lineScroll to the max value
-    if (m_view->dynWordWrap())
-      m_maximizeLineScroll = true;
-
     // Re-check we're not just scrolling to the same place
     if (!force && ((!m_view->dynWordWrap() && c.line() == (int)startLine()) || c == startPos()))
       return;
@@ -546,12 +540,7 @@
     maxLineScrollRange++;
   m_lineScroll->setRange(0, maxLineScrollRange);
 
-  if (m_view->dynWordWrap() && m_maximizeLineScroll) {
-    m_maximizeLineScroll = false;
-    m_lineScroll->setValue(maxStart.line());
-  } else {
-    m_lineScroll->setValue(startPos().line());
-  }
+  m_lineScroll->setValue(startPos().line());
   m_lineScroll->setSingleStep(1);
   m_lineScroll->setPageStep(height() / renderer()->fontHeight());
   m_lineScroll->blockSignals(false);
--- trunk/KDE/kdelibs/kate/part/kateviewinternal.h #555119:555120
@@ -366,10 +366,6 @@
     static const int s_scrollTime = 30;
     static const int s_scrollMargin = 16;
 
-    // dyn wrap mode:
-    // used to set the lineScroll to the max value
-    bool m_maximizeLineScroll;
-
   private Q_SLOTS:
     void scrollTimeout ();
     void cursorTimeout ();