summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté <mikisabate@gmail.com>2014-01-22 10:32:13 (GMT)
committerMiquel Sabaté <mikisabate@gmail.com>2014-01-22 10:32:13 (GMT)
commit5c712e5c71526c80486e6593a35f780902472be2 (patch)
tree7a88b5cd17ac6ecf61a9b7f4d1cac1300e041ea5
parent67f2796e37b50e6821d8f397192eda5d7e381d9c (diff)
vimode: added some motions that were missing in visual mode.
REVIEW: 115205
-rw-r--r--part/vimode/katevivisualmode.cpp8
-rw-r--r--tests/vimode_test.cpp13
2 files changed, 21 insertions, 0 deletions
diff --git a/part/vimode/katevivisualmode.cpp b/part/vimode/katevivisualmode.cpp
index d912860..30cac0e 100644
--- a/part/vimode/katevivisualmode.cpp
+++ b/part/vimode/katevivisualmode.cpp
@@ -368,12 +368,20 @@ void KateViVisualMode::initializeCommands()
ADDMOTION("<pageup>", motionPageUp, 0 );
ADDMOTION("gj", motionToNextVisualLine, 0 );
ADDMOTION("gk", motionToPrevVisualLine, 0);
+ ADDMOTION("(", motionToPreviousSentence, 0 );
+ ADDMOTION(")", motionToNextSentence, 0 );
ADDMOTION("{", motionToBeforeParagraph, 0 );
ADDMOTION("}", motionToAfterParagraph, 0 );
// text objects
ADDMOTION("iw", textObjectInnerWord, 0 );
ADDMOTION("aw", textObjectAWord, 0 );
+ ADDMOTION("iW", textObjectInnerWORD, 0 );
+ ADDMOTION("aW", textObjectAWORD, IS_NOT_LINEWISE );
+ ADDMOTION("is", textObjectInnerSentence, IS_NOT_LINEWISE );
+ ADDMOTION("as", textObjectASentence, IS_NOT_LINEWISE );
+ ADDMOTION("ip", textObjectInnerParagraph, IS_NOT_LINEWISE );
+ ADDMOTION("ap", textObjectAParagraph, IS_NOT_LINEWISE );
ADDMOTION("i\"", textObjectInnerQuoteDouble, CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION);
ADDMOTION("a\"", textObjectAQuoteDouble, 0 );
ADDMOTION("i'", textObjectInnerQuoteSingle, CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION );
diff --git a/tests/vimode_test.cpp b/tests/vimode_test.cpp
index fcd7735..c6400a8 100644
--- a/tests/vimode_test.cpp
+++ b/tests/vimode_test.cpp
@@ -772,6 +772,19 @@ void ViModeTest::VisualModeTests() {
// BUG #328277 - make sure kate doesn't crash
DoTest("aaa\nbbb", "Vj>u>.", " aaa\n bbb", ShouldFail, "Crash is fixed, but correct repeat behaviour in this scenario is yet to be implemented");
+
+ // Selection with regular motions.
+ DoTest("Three. Different. Sentences.", "v)cX", "Xifferent. Sentences.");
+ DoTest("Three. Different. Sentences.", "v)cX", "Xifferent. Sentences.");
+ DoTest("Three. Different. Sentences.", "v)cX", "Xifferent. Sentences.");
+ DoTest("Three. Different. Sentences.", "viWcX", "X Different. Sentences.");
+ DoTest("Three. Different. Sentences.", "viwcX", "X. Different. Sentences.");
+ DoTest("Three. Different. Sentences.", "vaWcX", "XDifferent. Sentences.");
+ DoTest("Three. Different. Sentences.", "vawcX", "X. Different. Sentences.");
+ DoTest("Three. Different. Sentences.", "vascX", "XDifferent. Sentences.");
+ DoTest("Three. Different. Sentences.", "viscX", "X Different. Sentences.");
+ DoTest("Three. Different. Sentences.", "vapcX", "X");
+ DoTest("Three. Different. Sentences.", "vipcX", "X");
}
void ViModeTest::ReplaceModeTests()