From 3c2cb66c8fadcfc644c56ca0c049e5633790d146 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: Sat, 16 Apr 2016 22:33:02 +0800 Subject: [PATCH] Bug fix for count movement --- .../src/Components/Vim/Actions/SHIFT_LINES.js | 22 +++++++++++++++---- botanjs/src/Components/Vim/Controls.js | 17 +++++++++----- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/botanjs/src/Components/Vim/Actions/SHIFT_LINES.js b/botanjs/src/Components/Vim/Actions/SHIFT_LINES.js index f52ca0a..0e83a39 100644 --- a/botanjs/src/Components/Vim/Actions/SHIFT_LINES.js +++ b/botanjs/src/Components/Vim/Actions/SHIFT_LINES.js @@ -28,8 +28,8 @@ this.__slineNum = Cursor.getLine().lineNum; - this.__lines = e.count; - debug.Info( "Open shift: " + this.__lines + " line(s) below the cursor" ); + this.__lines = e.count - 1; + debug.Info( "Open shift: " + this.__lines + " line(s) from the cursor" ); this.__direction = e.kMap( ">" ) ? 1 : -1; debug.Info( "Direction is: " + ( this.__direction == 1 ? ">" : "<" ) ); @@ -62,7 +62,7 @@ if( 1 < e.count ) { - nline += e.count; + nline += ( e.count - 1 ); } // default: >>, <<, >l,