Browse Source

Fixes the cursor not being showing if the text length is equal to the view width.

BDisp 3 years ago
parent
commit
4df5897318
2 changed files with 2 additions and 2 deletions
  1. 1 1
      Terminal.Gui/Views/TextView.cs
  2. 1 1
      UnitTests/TextViewTests.cs

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

@@ -308,7 +308,7 @@ namespace Terminal.Gui {
 						col++;
 					}
 					break;
-				} else if (end < t.Count && col > 0 && start < end && col == start) {
+				} else if ((end < t.Count && col > 0 && start < end && col == start) || (end - col == width - 1)) {
 					break;
 				}
 				col = i;

+ 1 - 1
UnitTests/TextViewTests.cs

@@ -1814,7 +1814,7 @@ namespace Terminal.Gui.Views {
 						col++;
 					}
 					break;
-				} else if (cCol < line.Length && col > 0 && start < cCol && col == start) {
+				} else if ((cCol < line.Length && col > 0 && start < cCol && col == start) || (cCol - col == width - 1)) {
 					break;
 				}
 				col = i;