Fixed warnings

This commit is contained in:
Tig
2024-07-19 15:59:06 -06:00
parent ee57f41b9f
commit 153f1015d7
3 changed files with 39 additions and 5 deletions

View File

@@ -309,7 +309,7 @@ public class TextFormatter
int start = isVertical ? screen.Top : screen.Left;
int size = isVertical ? screen.Height : screen.Width;
int current = start + colOffset;
List<Point?> lastZeroWidthPos = null;
List<Point?> lastZeroWidthPos = null!;
Rune rune = default;
int zeroLengthCount = isVertical ? runes.Sum (r => r.GetColumns () == 0 ? 1 : 0) : 0;
@@ -378,12 +378,12 @@ public class TextFormatter
{
lastZeroWidthPos [foundIdx] =
new Point (
lastZeroWidthPos [foundIdx].Value.X + 1,
lastZeroWidthPos [foundIdx]!.Value.X + 1,
current
);
driver?.Move (
lastZeroWidthPos [foundIdx].Value.X,
lastZeroWidthPos [foundIdx]!.Value.X,
current
);
}
@@ -1758,7 +1758,7 @@ public class TextFormatter
return lineResult;
}
string [] lines = null;
string []? lines = null;
if (text.Contains ("\r\n"))
{
@@ -1967,7 +1967,7 @@ public class TextFormatter
/// <returns>The index of the text that fit the width.</returns>
public static int GetLengthThatFits (string text, int width, int tabWidth = 0, TextDirection textDirection = TextDirection.LeftRight_TopBottom)
{
return GetLengthThatFits (text?.ToRuneList (), width, tabWidth, textDirection);
return GetLengthThatFits (text.ToRuneList (), width, tabWidth, textDirection);
}
/// <summary>Gets the number of the Runes in a list of Runes that will fit in <paramref name="width"/>.</summary>