From 4df5897318f84dee46593078ed13fd14ed311d04 Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 23 Jan 2022 23:14:47 +0000 Subject: [PATCH] Fixes the cursor not being showing if the text length is equal to the view width. --- Terminal.Gui/Views/TextView.cs | 2 +- UnitTests/TextViewTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Terminal.Gui/Views/TextView.cs b/Terminal.Gui/Views/TextView.cs index e6f7597f2..5753c4d27 100644 --- a/Terminal.Gui/Views/TextView.cs +++ b/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; diff --git a/UnitTests/TextViewTests.cs b/UnitTests/TextViewTests.cs index fa29e5d85..8852d0b70 100644 --- a/UnitTests/TextViewTests.cs +++ b/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;