penguin/AstroJS

Javascript framework for my blog

commit 1bc1a90b31fc3e4c308b318f6fdd1c72bbdcb814

author斟酌 鵬兄 <tgckpg@gmail.com>
date2016-03-30T18:51:42Z
subjectFixed a -> Enter -> BS -> Esc -> u inconsistency
commit 1bc1a90b31fc3e4c308b318f6fdd1c72bbdcb814
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2016-03-30T18:51:42Z

    Fixed a -> Enter -> BS -> Esc -> u inconsistency
---
 botanjs/src/Components/Vim/Actions/INSERT.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/botanjs/src/Components/Vim/Actions/INSERT.js b/botanjs/src/Components/Vim/Actions/INSERT.js
index e67f083..7eb38eb 100644
--- a/botanjs/src/Components/Vim/Actions/INSERT.js
+++ b/botanjs/src/Components/Vim/Actions/INSERT.js
@@ -39,8 +39,8 @@
 
 	INSERT.prototype.dispose = function()
 	{
-		this.__cursor.moveX( -1 );
 		this.__rec( "", true );
+		this.__cursor.moveX( -1 );
 	};
 
 	INSERT.prototype.__rec = function( c, newRec )
@@ -92,12 +92,13 @@
 			if( this.__insertLength <= 0 )
 			{
 				this.__contentUndo = feeder.content.substr( f, 1 ) + this.__contentUndo;
-				this.__insertLength --;
 			}
 
 			feeder.content =
 				feeder.content.substring( 0, f )
 				+ feeder.content.substring( f + 1 );
+
+			this.__insertLength --;
 		}
 		else if( e.kMap( "Del" ) )
 		{