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

List:       kwrite-devel
Subject:    [PATCH] Kate - Double click cursor fix
From:       Nadeem Hasan <nhasan () nadmm ! com>
Date:       2002-03-06 17:54:53
[Download RAW message or body]

Hi,

The patch below fixes the cursor jumping problem on doubleclick. If
one doubleclicks at a non-word character, nothing is selected and the 
cursor jumps to the start of the file. This was because updateCursor() 
was called without checking if a selection resulted in selectWord().

diff -u -r1.113 kateview.cpp
--- kateview.cpp    2002/03/04 11:40:11 1.113
+++ kateview.cpp    2002/03/06 17:50:55
@@ -1084,11 +1095,22 @@
     getVConfig(c);
     myDoc->selectWord(c.cursor, c.flags);
     // anders: move cursor to end of selected word
-    cursor.col = myDoc->selectEnd.col;
-    cursor.line = myDoc->selectEnd.line;
-    updateCursor( cursor, true );
+    if (myDoc->hasSelection())
+    {
+      cursor.col = myDoc->selectEnd.col;
+      cursor.line = myDoc->selectEnd.line;
+      updateCursor( cursor, true );
+    }
     //myDoc->updateViews(); allready called by document->setSelection()
   }
 }
Cheers,
-- 
Nadeem Hasan
nhasan@nadmm.com
http://www.nadmm.com/
_______________________________________________
kwrite-devel mailing list
kwrite-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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