From 3d2f3b889a8456a6fad1c353e3a1faea1ba9fe3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Sun, 3 Apr 2016 20:19:45 +0800 Subject: [PATCH] Used the wrong movement function --- botanjs/src/Components/Vim/Actions/TO.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/botanjs/src/Components/Vim/Actions/TO.js b/botanjs/src/Components/Vim/Actions/TO.js index b1a0dbc..1ff0bcd 100644 --- a/botanjs/src/Components/Vim/Actions/TO.js +++ b/botanjs/src/Components/Vim/Actions/TO.js @@ -28,8 +28,8 @@ var f = cur.feeder; var n = cur.getLine().lineNum; - var p = f.content.indexOf( "\n" ); - for( i = 1; p != -1 && i < n; i ++ ) + var p = 0; + for( i = 0; p != -1 && i < n; i ++ ) { p = f.content.indexOf( "\n", p + 1 ); } @@ -68,7 +68,7 @@ if( lowerLimmit <= tX && tX < upperLimit ) { - cur.moveX( tX - lowerLimmit - cX ); + cur.moveTo( tX ); } else beep(); };