[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kate/vimode
From: Erlend Hamberg <ehamberg () gmail ! com>
Date: 2009-09-29 17:22:15
Message-ID: 1254244935.007706.21853.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1029411 by ehamberg:
add <c-f> and <c-b> in visual mode
M +28 -0 katevinormalmode.cpp
M +3 -0 katevinormalmode.h
M +4 -0 katevivisualmode.cpp
--- trunk/KDE/kdelibs/kate/vimode/katevinormalmode.cpp #1029410:1029411
@@ -1281,6 +1281,34 @@
return r;
}
+KateViRange KateViNormalMode::motionPageDown()
+{
+ KTextEditor::Cursor c( m_view->cursorPosition() );
+ int linesToScroll = linesDisplayed();
+
+ KateViRange r( c.line()+linesToScroll, c.column(), ViMotion::InclusiveMotion );
+
+ if ( r.endLine >= doc()->lines() ) {
+ r.endLine = doc()->lines()-1;
+ }
+
+ return r;
+}
+
+KateViRange KateViNormalMode::motionPageUp()
+{
+ KTextEditor::Cursor c( m_view->cursorPosition() );
+ int linesToScroll = linesDisplayed();
+
+ KateViRange r( c.line()-linesToScroll, c.column(), ViMotion::InclusiveMotion );
+
+ if ( r.endLine < 0 ) {
+ r.endLine = 0;
+ }
+
+ return r;
+}
+
KateViRange KateViNormalMode::motionWordForward()
{
KTextEditor::Cursor c( m_view->cursorPosition() );
--- trunk/KDE/kdelibs/kate/vimode/katevinormalmode.h #1029410:1029411
@@ -136,6 +136,9 @@
KateViRange motionDown();
KateViRange motionUp();
+ KateViRange motionPageDown();
+ KateViRange motionPageUp();
+
KateViRange motionWordForward();
KateViRange motionWordBackward();
KateViRange motionWORDForward();
--- trunk/KDE/kdelibs/kate/vimode/katevivisualmode.cpp #1029410:1029411
@@ -280,6 +280,10 @@
m_motions.push_back( new KateViMotion( this, "]]", \
&KateViNormalMode::motionToNextBraceBlockStart ) ); m_motions.push_back( new \
KateViMotion( this, "[]", &KateViNormalMode::motionToPreviousBraceBlockEnd ) ); \
m_motions.push_back( new KateViMotion( this, "][", \
&KateViNormalMode::motionToNextBraceBlockEnd ) ); + m_motions.push_back( new \
KateViMotion( this, "<c-f>", &KateViNormalMode::motionPageDown ) ); + \
m_motions.push_back( new KateViMotion( this, "<pagedown>", \
&KateViNormalMode::motionPageDown ) ); + m_motions.push_back( new KateViMotion( \
this, "<c-b>", &KateViNormalMode::motionPageUp ) ); + m_motions.push_back( new \
KateViMotion( this, "<pageup>", &KateViNormalMode::motionPageUp ) );
// text objects
m_motions.push_back( new KateViMotion( this, "iw", \
&KateViNormalMode::textObjectInnerWord ) );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic