فهرست منبع

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

BDisp 2 سال پیش
والد
کامیت
5b00dcfd04
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  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);