Bug 131369

Summary: Kate flashes highlighting from document start after double click.
Product: [Applications] kate Reporter: Tim Hutt <tdhutt>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Tim Hutt 2006-07-25 22:30:25 UTC
Version:            (using KDE KDE 3.5.3)
Installed from:    Ubuntu Packages

Finally worked out how to reproduce a bug that has been annoying me for years.

To reproduce:
1) Open a document (HTML in this case but I doubt it matters).
2) Select some text at the end of a line.
3) Move the mouse past the end of that line, so it turns into an arrow instead of and I-bar.
4) Double click, but hold the mouse down on the second click, and drag it around.

Results:

Every time the cursor moves onto a new line, all the text before it gets highlighted, and then the highlight is removed in a series of flashes.

Correct results: No flashes.

After further investigation, most of those steps aren't necessary. Just double click past the end of a line (ie where there is no text), and drag. Weird highlighting ensues.
Comment 1 Tim Hutt 2006-07-25 22:32:12 UTC
And further investigation (by moving the mouse slowly) reveals that the flashes aren't "as quick as possible" flashes, but are due to it highlighting the stuff only when the mouse is in a really narrow (probably 1 px) area between the lines of text.
Comment 2 Andreas Kling 2006-07-25 23:51:26 UTC
SVN commit 566355 by kling:

Don't enter "word selection mode" without an actual selection.

BUG: 131369


 M  +5 -0      kateviewinternal.cpp  


--- branches/KDE/3.5/kdelibs/kate/part/kateviewinternal.cpp #566354:566355
@@ -2744,6 +2744,11 @@
         selectAnchor = KateTextCursor (m_view->selEndLine(), m_view->selEndCol());
         selStartCached = m_view->selectStart;
         selEndCached = m_view->selectEnd;
+
+        // if we didn't actually select anything, restore the selection mode
+        // -- see bug #131369 (kling)
+        if (!m_view->hasSelection())
+          m_selectionMode = Default;
       }
 
       // Move cursor to end of selected word
Comment 3 Tim Hutt 2006-07-26 00:18:35 UTC
Wow! Quick.

Thanks!
Comment 4 Andreas Kling 2006-08-06 18:58:30 UTC
SVN commit 570416 by kling:

Forward-port of SVN commit 566355 by kling:

Don't enter "word selection mode" without an actual selection.

CCBUG: 131369


 M  +5 -0      kateviewinternal.cpp  


--- trunk/KDE/kdelibs/kate/part/kateviewinternal.cpp #570415:570416
@@ -2400,6 +2400,11 @@
         m_view->selectWord( m_cursor );
         m_selectAnchor = m_view->selectionRange().end();
         m_selectionCached = m_view->selectionRange();
+
+        // if we didn't actually select anything, restore the selection mode
+        // -- see bug #131369 (kling)
+        if (!m_view->selection())
+          m_selectionMode = Default;
       }
 
       // Move cursor to end of selected word