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

List:       kde-commits
Subject:    branches/KDE/3.5/kdelibs/kate/part
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2007-02-28 23:52:56
Message-ID: 1172706776.971791.32528.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 638155 by mwoehlke:

(1) Grow initial selection to full line on shift+TC to conform to standards
(2) Set cursor position correctly on TC+drag (upwards)
(3) Disable broken shift+DC code because it a: doesn't work anyway, and b: breaks (2)


 M  +17 -7     kateviewinternal.cpp  


--- branches/KDE/3.5/kdelibs/kate/part/kateviewinternal.cpp #638154:638155
@@ -2083,16 +2083,26 @@
         case Line:
           if ( newCursor.line() > selStartCached.line() )
           {
-            selectAnchor = selStartCached;
             if ( newCursor.line()+1 >= m_doc->numLines() )
               newCursor.setCol( m_doc->textLine( newCursor.line() ).length() );
             else
               newCursor.setPos( newCursor.line() + 1, 0 );
+            // Grow to include entire line
+            selectAnchor = selStartCached;
+            selectAnchor.setCol( 0 );
           }
           else if ( newCursor.line() < selStartCached.line() )
           {
+            newCursor.setCol( 0 );
+            // Grow to include entire line
             selectAnchor = selEndCached;
-            newCursor.setCol( 0 );
+            if ( selectAnchor.col() > 0 )
+            {
+              if ( selectAnchor.line()+1 >= m_doc->numLines() )
+                selectAnchor.setCol( m_doc->textLine( selectAnchor.line() ).length() );
+              else
+                selectAnchor.setPos( selectAnchor.line() + 1, 0 );
+            }
           }
           else // same line, ignore
             doSelect = false;
@@ -2744,10 +2754,10 @@
       if ( e->state() & Qt::ShiftButton )
       {
         // FIXME this is totally broken right now
-        selStartCached = m_view->selectStart;
-        selEndCached = m_view->selectEnd;
-        updateSelection( cursor, true );
-        updateCursor( selEndCached );
+//         selStartCached = m_view->selectStart;
+//         selEndCached = m_view->selectEnd;
+//         updateSelection( cursor, true );
+//         updateCursor( selEndCached );
       }
       else
       {
@@ -2819,7 +2829,7 @@
         QApplication::clipboard()->setSelectionMode( false );
         // Set cursor to edge of selection... which edge depends on what
         // "direction" the selection was made in
-        if ( m_view->selectStart < selStartCached )
+        if ( m_view->selectStart < selectAnchor )
           updateCursor( m_view->selectStart );
         else
           updateCursor( m_view->selectEnd );
[prev in list] [next in list] [prev in thread] [next in thread] 

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