+ /// 選択文字列のインデントを一つ増やす\r
+ /// </summary>\r
+ public void UpIndent()\r
+ {\r
+ if (this.RectSelection || this.SelectionLength == 0)\r
+ return;\r
+ int selectionStart = this.SelectionStart;\r
+ string text = this.InsertLineHead(GetTextFromLineSelectArea(this.View.Selections), "\t");\r
+ this.RepleaceSelectionArea(this.View.Selections,text);\r
+ this.Select(selectionStart, text.Length);\r
+ }\r
+\r
+ /// <summary>\r
+ /// 選択文字列のインデントを一つ減らす\r
+ /// </summary>\r
+ public void DownIndent()\r
+ {\r
+ if (this.RectSelection || this.SelectionLength == 0)\r
+ return;\r
+ int selectionStart = this.SelectionStart;\r
+ string text = this.RemoveLineHead(GetTextFromLineSelectArea(this.View.Selections), "\t");\r
+ this.RepleaceSelectionArea(this.View.Selections, text);\r
+ this.Select(selectionStart, text.Length);\r
+ }\r
+\r
+ string InsertLineHead(string s, string str)\r
+ {\r
+ string[] lines = s.Split(new string[] { Document.NewLine.ToString() }, StringSplitOptions.RemoveEmptyEntries);\r
+ StringBuilder output = new StringBuilder();\r
+ for (int i = 0; i < lines.Length; i++)\r
+ output.AppendLine(str + lines[i]);\r
+ return output.ToString();\r
+ }\r
+\r
+ public string RemoveLineHead(string s, string str)\r
+ {\r
+ string[] lines = s.Split(new string[] { Document.NewLine.ToString() }, StringSplitOptions.RemoveEmptyEntries);\r
+ StringBuilder output = new StringBuilder();\r
+ for (int i = 0; i < lines.Length; i++)\r
+ if (lines[i].StartsWith(str))\r
+ output.AppendLine(lines[i].Substring(1));\r
+ else\r
+ output.AppendLine(lines[i]);\r
+ return output.ToString();\r
+ }\r
+\r
+ /// <summary>\r