From 4b200697dcebbbbc004b124c0d002412d1461bc7 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: Mon, 9 Jan 2017 10:48:00 +0800 Subject: [PATCH] Fixed autoIndent by tab pos error --- botanjs/src/Components/Vim/Actions/INSERT.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/botanjs/src/Components/Vim/Actions/INSERT.js b/botanjs/src/Components/Vim/Actions/INSERT.js index 08310ea..4beaca5 100644 --- a/botanjs/src/Components/Vim/Actions/INSERT.js +++ b/botanjs/src/Components/Vim/Actions/INSERT.js @@ -197,7 +197,7 @@ { this.__realizeIndent(); feeder.pan(); - cur.moveX( 1, false, true ); + cur.moveX( inputChar == "\t" ? feeder.firstBuffer.tabWidth : 1, false, true ); } feeder.dispatcher.dispatchEvent( new BotanEvent( "VisualUpdate" ) ); @@ -262,7 +262,7 @@ feeder.softReset(); feeder.pan(); - cur.moveX( i, false, true ); + cur.moveX( i * feeder.firstBuffer.tabWidth, false, true ); var a = []; a[ IN_START ] = f;