Skip to content
This repository
Browse code

[vim] Fix :num and add unit test

  • Loading branch information...
commit 740366d3a2aba3c6d1a3a1affd50ed4d08f1ed05 1 parent 192b2c2
Yunchi Luo authored marijnh committed
3  keymap/vim.js
@@ -2543,7 +2543,8 @@
2543 2543
         exCommandDispatcher.map(mapArgs[0], mapArgs[1], cm);
2544 2544
       },
2545 2545
       move: function(cm, params) {
2546  
-        commandDispatcher.processMotion(cm, getVimState(cm), {
  2546
+        commandDispatcher.processCommand(cm, getVimState(cm), {
  2547
+            type: 'motion',
2547 2548
             motion: 'moveToLineOrEdgeOfDocument',
2548 2549
             motionArgs: { forward: false, explicitRepeat: true,
2549 2550
               linewise: true },
5  test/vim_test.js
@@ -1158,6 +1158,11 @@ testVim('._repeat', function(cm, vim, helpers) {
1158 1158
 }, { value: '1 2 3 4 5 6'});
1159 1159
 
1160 1160
 // Ex mode tests
  1161
+testVim('ex_go_to_line', function(cm, vim, helpers) {
  1162
+  cm.setCursor(0, 0);
  1163
+  helpers.doEx('4');
  1164
+  helpers.assertCursorAt(3, 0);
  1165
+}, { value: 'a\nb\nc\nd\ne\n'});
1161 1166
 testVim('ex_write', function(cm, vim, helpers) {
1162 1167
   var tmp = CodeMirror.commands.save;
1163 1168
   var written;

0 notes on commit 740366d

Please sign in to comment.
Something went wrong with that request. Please try again.