From 68ee6dacc6258059cc3dba8eebf0fd27448d3851 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= <tgckpg@gmail.com>
Date: Wed, 15 Mar 2017 15:12:42 +0800
Subject: [PATCH] Fixed JOIN_LINES did not work properly

---
 botanjs/src/Components/Vim/Actions/JOIN_LINES.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/botanjs/src/Components/Vim/Actions/JOIN_LINES.js b/botanjs/src/Components/Vim/Actions/JOIN_LINES.js
index 4f21af69..43627655 100644
--- a/botanjs/src/Components/Vim/Actions/JOIN_LINES.js
+++ b/botanjs/src/Components/Vim/Actions/JOIN_LINES.js
@@ -66,7 +66,10 @@
 
 			var content = feeder.content;
 
-			contentUndo = feeder.content.substring( start, end );
+			var l = content.length;
+			while( "\t ".indexOf( content[ end ] ) != -1 && end < l ) end ++;
+
+			contentUndo = content.substring( start, end );
 			feeder.content = content.substring( 0, start ) + " " + content.substr( end );
 		}