فهرست منبع

Extract TextViewAutocomplete to separate file

Move TextViewAutocomplete class from TextView.cs to TextViewAutocomplete.cs

Build and all 163 tests pass
Tig 3 هفته پیش
والد
کامیت
26b3fc916d
2فایلهای تغییر یافته به همراه22 افزوده شده و 21 حذف شده
  1. 1 21
      Terminal.Gui/Views/TextInput/TextView/TextView.cs
  2. 21 0
      Terminal.Gui/Views/TextInput/TextView/TextViewAutocomplete.cs

+ 1 - 21
Terminal.Gui/Views/TextInput/TextView/TextView.cs

@@ -4884,24 +4884,4 @@ public class TextView : View, IDesignable
 
         base.Dispose (disposing);
     }
-}
-
-/// <summary>
-///     Renders an overlay on another view at a given point that allows selecting from a range of 'autocomplete'
-///     options. An implementation on a TextView.
-/// </summary>
-public class TextViewAutocomplete : PopupAutocomplete
-{
-    /// <inheritdoc/>
-    protected override void DeleteTextBackwards () { ((TextView)HostControl!).DeleteCharLeft (); }
-
-    /// <inheritdoc/>
-    protected override void InsertText (string accepted) { ((TextView)HostControl!).InsertText (accepted); }
-
-    /// <inheritdoc/>
-    protected override void SetCursorPosition (int column)
-    {
-        ((TextView)HostControl!).CursorPosition =
-            new (column, ((TextView)HostControl).CurrentRow);
-    }
-}
+}

+ 21 - 0
Terminal.Gui/Views/TextInput/TextView/TextViewAutocomplete.cs

@@ -0,0 +1,21 @@
+namespace Terminal.Gui.Views;
+
+/// <summary>
+///     Renders an overlay on another view at a given point that allows selecting from a range of 'autocomplete'
+///     options. An implementation on a TextView.
+/// </summary>
+public class TextViewAutocomplete : PopupAutocomplete
+{
+    /// <inheritdoc/>
+    protected override void DeleteTextBackwards () { ((TextView)HostControl!).DeleteCharLeft (); }
+
+    /// <inheritdoc/>
+    protected override void InsertText (string accepted) { ((TextView)HostControl!).InsertText (accepted); }
+
+    /// <inheritdoc/>
+    protected override void SetCursorPosition (int column)
+    {
+        ((TextView)HostControl!).CursorPosition =
+            new (column, ((TextView)HostControl).CurrentRow);
+    }
+}