Bug 2995296 fix

git-svn-id: https://lsleditor.svn.sourceforge.net/svnroot/lsleditor@51 3f4676ac-adda-40fd-8265-58d1435b1672
This commit is contained in:
niel-archer 2011-12-30 03:46:08 +00:00
parent 1303b04de3
commit e43dd7f4a0

View file

@ -1748,14 +1748,18 @@ namespace LSLEditor
string strW = GetNewWhiteSpace(-1);
int intTabs = (int)(strW.Length / AutoFormatter.GetTab().Length);
if (this.SelectionLength == 0)
{
int intLastLine = this.GetLineFromCharIndex(this.SelectionStart + this.SelectionLength);
int intLine = this.GetLineFromCharIndex(this.SelectionStart);
int intStart = this.GetFirstCharIndexFromLine(intLine);
int intLength = this.Lines[intLine].Length + 1;
this.SelectionStart = intStart;
this.SelectionStart = this.GetFirstCharIndexFromLine(intLine);
int intLength = 0;
do
{
intLength += this.Lines[intLine].Length + 1;
intLine++;
} while (intLine <= intLastLine);
this.SelectionLength = intLength;
}
string strSelectedText = AutoFormatter.MultiLineComment(blnAdd, intTabs, this.SelectedText);
int intBackup = this.SelectionStart;