From 74c7460846f08d0a2c45589c670e55988a951965 Mon Sep 17 00:00:00 2001
From: "maxim@mnikolenko" <maxim@mnikolenko>
Date: Mon, 20 Jan 2014 12:48:58 +0200
Subject: [PATCH] MAINT-3618 FIXED Don't copy spaces after cursor to the next
 line.

---
 indra/llui/lltexteditor.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 81d9fd1ec9c..7896fcef954 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2338,7 +2338,8 @@ void LLTextEditor::autoIndent()
 	S32 i;
 
 	LLWString text = getWText();
-	while( ' ' == text[line_start] )
+	S32 offset = getLineOffsetFromDocIndex(mCursorPos);
+	while(( ' ' == text[line_start] ) && (space_count < offset))
 	{
 		space_count++;
 		line_start++;
-- 
GitLab