OSDN Git Service

Shift+Hone、Shift+Endを実装した
authorgdkhd812 <jbh03215@htmil.co.jp>
Thu, 17 Oct 2013 07:07:32 +0000 (16:07 +0900)
committergdkhd812 <jbh03215@htmil.co.jp>
Thu, 17 Oct 2013 07:07:32 +0000 (16:07 +0900)
Common/Controller.cs
Metro/FooEditEngine/FooTextBox.cs
WPF/FooEditEngine/FooTextBox.cs
Windows/FooEditEngine/FooTextBox.cs

index 641db78..cd8a8a4 100644 (file)
@@ -393,6 +393,30 @@ namespace FooEditEngine
         }\r
 \r
         /// <summary>\r
+        /// 行の先頭に移動する\r
+        /// </summary>\r
+        /// <param name="row">行</param>\r
+        /// <param name="isSelected">選択状態にするかどうか</param>\r
+        public void JumpToLineHead(int row,bool isSelected)\r
+        {\r
+            this.View.JumpCaret(row, 0);\r
+            this.View.AdjustCaretAndSrc();\r
+            this.SelectWithMoveCaret(isSelected);\r
+        }\r
+\r
+        /// <summary>\r
+        /// 行の終わりに移動する\r
+        /// </summary>\r
+        /// <param name="row">行</param>\r
+        /// <param name="isSelected">選択状態にするかどうか</param>\r
+        public void JumpToLineEnd(int row, bool isSelected)\r
+        {\r
+            this.View.JumpCaret(row, this.View.LayoutLines[row].Length - 1);\r
+            this.View.AdjustCaretAndSrc();\r
+            this.SelectWithMoveCaret(isSelected);\r
+        }\r
+\r
+        /// <summary>\r
         /// ドキュメントの先頭に移動する\r
         /// </summary>\r
         /// <param name="isSelected"></param>\r
index 06ab972..1f6d169 100644 (file)
@@ -469,7 +469,7 @@ namespace FooEditEngine.Metro
                     if (isControlPressed)\r
                         this._Controller.JumpToHead(isShiftPressed);\r
                     else\r
-                        this._Controller.JumpCaret(this.View.CaretPostion.row, 0);\r
+                        this.Controller.JumpToLineHead(this.View.CaretPostion.row,isShiftPressed);\r
                     this.Refresh();\r
                     isMovedCaret = true;\r
                     break;\r
@@ -477,7 +477,7 @@ namespace FooEditEngine.Metro
                     if (isControlPressed)\r
                         this._Controller.JumpToEnd(isShiftPressed);\r
                     else\r
-                        this._Controller.JumpCaret(this.View.CaretPostion.row, this.View.LayoutLines[this.View.CaretPostion.row].Length - 1);\r
+                        this.Controller.JumpToLineEnd(this.View.CaretPostion.row,isShiftPressed);\r
                     this.Refresh();\r
                     isMovedCaret = true;\r
                     break;\r
index 1e1639a..834f0cf 100644 (file)
@@ -704,7 +704,7 @@ namespace FooEditEngine.WPF
                     if (this.IsPressedModifierKey(modiferKeys, ModifierKeys.Control))\r
                         this._Controller.JumpToHead(this.IsPressedModifierKey(modiferKeys, ModifierKeys.Shift));\r
                     else\r
-                        this._Controller.JumpCaret(this.View.CaretPostion.row, 0);\r
+                        this._Controller.JumpToLineHead(this.View.CaretPostion.row, this.IsPressedModifierKey(modiferKeys, ModifierKeys.Shift));\r
                     this.Refresh();\r
                     movedCaret = true;\r
                     break;\r
@@ -712,7 +712,7 @@ namespace FooEditEngine.WPF
                     if (this.IsPressedModifierKey(modiferKeys, ModifierKeys.Control))\r
                         this._Controller.JumpToEnd(this.IsPressedModifierKey(modiferKeys, ModifierKeys.Shift));\r
                     else\r
-                        this._Controller.JumpCaret(this.View.CaretPostion.row, this.View.LayoutLines[this.View.CaretPostion.row].Length - 1);\r
+                        this._Controller.JumpToLineEnd(this.View.CaretPostion.row, this.IsPressedModifierKey(modiferKeys, ModifierKeys.Shift));\r
                     this.Refresh();\r
                     movedCaret = true;\r
                     break;\r
index fdc4f48..da609bf 100644 (file)
@@ -1204,16 +1204,16 @@ namespace FooEditEngine.Windows
                     break;\r
                 case Keys.Home:\r
                     if (e.Control)\r
-                        this.Controller.JumpToHead(false);\r
+                        this.Controller.JumpToHead(e.Shift);\r
                     else\r
-                        this.Controller.JumpCaret(this.View.CaretPostion.row, 0);\r
+                        this.Controller.JumpToLineHead(this.View.CaretPostion.row, e.Shift);\r
                     this.Refresh();\r
                     break;\r
                 case Keys.End:\r
                     if (e.Control)\r
-                        this.Controller.JumpToEnd(false);\r
+                        this.Controller.JumpToEnd(e.Shift);\r
                     else\r
-                        this.Controller.JumpCaret(this.View.CaretPostion.row, this.View.LayoutLines[this.View.CaretPostion.row].Length - 1);\r
+                        this.Controller.JumpToLineEnd(this.View.CaretPostion.row, e.Shift);\r
                     this.Refresh();\r
                     break;\r
                 case Keys.Tab:\r