Procházet zdrojové kódy

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

BDisp před 2 roky
rodič
revize
5b00dcfd04
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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);