Bug 106402 - 5+clicks causes current line indicator to appear on multiple lines
Summary: 5+clicks causes current line indicator to appear on multiple lines
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 110159 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-28 04:29 UTC by evilmrhenry
Modified: 2006-06-30 12:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description evilmrhenry 2005-05-28 04:29:49 UTC
Version:           4.3 (using KDE KDE 3.3.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

To reproduce:

Open a document in Kwrite.
Click 5 or more times in the same spot. (Pentuple-click)
Kwrite will start moving a copy of the selected-line marker down for every two clicks after. (Sextuple click will have current line, non-current line, then another current line.)

Expected behaviour:
Kwrite would switch between selecting a word, and selecting a line.

Reproducable every time.
Comment 1 Christoph Cullmann 2005-09-29 17:21:12 UTC
*** Bug 110159 has been marked as a duplicate of this bug. ***
Comment 2 Dominik Haumann 2006-06-30 11:51:35 UTC
SVN commit 556448 by dhaumann:

 * fix: bracket matching works more reliable (also when you double/triple
        click on a line and then the cursor is placed on a ({[ or ]}))
 * fix: 5+clicks (and more) causes current line indicator to appear on
        multiple lines

BUG: 106402


 M  +8 -2      kateviewinternal.cpp  


--- branches/KDE/3.5/kdelibs/kate/part/kateviewinternal.cpp #556447:556448
@@ -2648,7 +2648,8 @@
           selEndCached = m_view->selectEnd;
 
           cursor.setCol(0);
-          updateCursor( cursor );
+          updateCursor( cursor, true );
+          e->accept ();
           return;
         }
 
@@ -2701,6 +2702,11 @@
       }
       else
       {
+        // first clear the selection, otherweise we run into bug #106402
+        // Parameters: 1st false: don't redraw
+        //             2nd false: don't emit selectionChanged signals, as
+        //             selectWord() emits this already
+        m_view->clearSelection( false, false );
         m_view->selectWord( cursor );
         selectAnchor = KateTextCursor (m_view->selEndLine(), m_view->selEndCol());
         selStartCached = m_view->selectStart;
@@ -2715,7 +2721,7 @@
         QApplication::clipboard()->setSelectionMode( false );
 
         cursor.setPos(m_view->selectEnd);
-        updateCursor( cursor );
+        updateCursor( cursor, true );
 
         selStartCached = m_view->selectStart;
         selEndCached = m_view->selectEnd;
Comment 3 Dominik Haumann 2006-06-30 12:01:13 UTC
SVN commit 556450 by dhaumann:

 * fix: bracket matching works more reliable (also when you double/triple
        click on a line and then the cursor is placed on a ({[ or ]}))
 * fix: 5+clicks (and more) causes current line indicator to appear on
        multiple lines

CCBUG: 106402
-- Diese und de folgenden Zeilen werden ignoriert --

M    kateviewinternal.cpp


 M  +6 -2      kateviewinternal.cpp  


--- trunk/KDE/kdelibs/kate/part/kateviewinternal.cpp #556449:556450
@@ -2321,7 +2321,8 @@
           m_selectionCached = m_view->selectionRange();
 
           m_cursor.setColumn(0);
-          updateCursor( m_cursor );
+          updateCursor( m_cursor, true );
+          e->accept();
           return;
         }
 
@@ -2372,6 +2373,9 @@
       }
       else
       {
+        // first clear the selection, otherweise we run into bug #106402
+        // Parameters: don't redraw, and don't emit selectionChanged signal yet
+        m_view->clearSelection( false, false );
         m_view->selectWord( m_cursor );
         m_selectAnchor = m_view->selectionRange().end();
         m_selectionCached = m_view->selectionRange();
@@ -2383,7 +2387,7 @@
         QApplication::clipboard()->setText(m_view->selectionText (), QClipboard::Selection);
 
         m_cursor.setPosition(m_view->selectionRange().end());
-        updateCursor( m_cursor );
+        updateCursor( m_cursor, true );
 
         m_selectionCached = m_view->selectionRange();
       }