Explorar o código

Fixes #2429. Error when replacing a word in textView.

BDisp %!s(int64=2) %!d(string=hai) anos
pai
achega
5b00dcfd04
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Terminal.Gui/Views/TextView.cs

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

@@ -387,7 +387,7 @@ namespace Terminal.Gui {
 						pos = new Point (col, i);
 						col += (textToReplace.Length - matchText.Length);
 					}
-					if (col + 1 > txt.Length) {
+					if (col < 0 || col + 1 > txt.Length) {
 						break;
 					}
 					col = txt.IndexOf (matchText, col + 1);