Browse Source

Merge branch 'v2_develop' into v2_2491-Arrangement-Overlapped

Tig 11 months ago
parent
commit
52ce3494fa
1 changed files with 15 additions and 3 deletions
  1. 15 3
      Terminal.Gui/Views/TextField.cs

+ 15 - 3
Terminal.Gui/Views/TextField.cs

@@ -1016,8 +1016,7 @@ public class TextField : View
 
 
         RenderCaption ();
         RenderCaption ();
 
 
-        ProcessAutocomplete ();
-
+        DrawAutocomplete ();
         _isDrawing = false;
         _isDrawing = false;
     }
     }
 
 
@@ -1767,8 +1766,21 @@ public class TextField : View
             return;
             return;
         }
         }
 
 
-        // draw autocomplete
         GenerateSuggestions ();
         GenerateSuggestions ();
+    }
+
+    private void DrawAutocomplete ()
+    {
+
+        if (SelectedLength > 0)
+        {
+            return;
+        }
+
+        if (Autocomplete?.Context == null)
+        {
+            return;
+        }
 
 
         var renderAt = new Point (
         var renderAt = new Point (
                                   Autocomplete.Context.CursorPosition,
                                   Autocomplete.Context.CursorPosition,