Skip to content

Commit bf2e032

Browse files
committed
Fixed Time/DateField crash
1 parent 64f87cd commit bf2e032

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Terminal.Gui/Views/DateField.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ private void AdjCursorPosition (int point, bool increment = true)
162162
newPoint = 1;
163163
}
164164

165-
if (newPoint != point)
165+
//if (newPoint != point)
166166
{
167167
CursorPosition = newPoint;
168168
}
169169

170-
while (Text [CursorPosition].ToString () == _separator)
170+
while (CursorPosition < Text.GetColumns () - 1 && Text [CursorPosition].ToString () == _separator)
171171
{
172172
if (increment)
173173
{

Terminal.Gui/Views/TimeField.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ private void AdjCursorPosition (int point, bool increment = true)
220220
newPoint = 1;
221221
}
222222

223-
if (newPoint != point)
223+
//if (newPoint != point)
224224
{
225225
CursorPosition = newPoint;
226226
}
227227

228-
while (Text [CursorPosition] == _sepChar [0])
228+
while (CursorPosition < Text.GetColumns() -1 && Text [CursorPosition] == _sepChar [0])
229229
{
230230
if (increment)
231231
{

0 commit comments

Comments
 (0)