removed comments

This commit is contained in:
Charlie Kindel
2020-07-13 17:53:21 -07:00
parent c3395f41ab
commit 856287d6dd
3 changed files with 4 additions and 19 deletions

View File

@@ -227,7 +227,7 @@ namespace Terminal.Gui {
end -= 1;
if (end == start)
end = start + width;
lines.Add (ustring.Make (runes.GetRange (start, end - start))); //.TrimStart ((rune) => rune == ' '));
lines.Add (ustring.Make (runes.GetRange (start, end - start)));
start = end;
if (runes[end] == ' ') {
start++;
@@ -235,7 +235,7 @@ namespace Terminal.Gui {
}
if (start < text.RuneCount) {
lines.Add (ustring.Make (runes.GetRange (start, runes.Count - start))); //.TrimStart ((rune) => rune == ' '));
lines.Add (ustring.Make (runes.GetRange (start, runes.Count - start)));
}
return lines;
@@ -286,15 +286,13 @@ namespace Terminal.Gui {
return text;
}
// TODO: Use ustring
var words = text.Split (ustring.Make (' '));// whitespace, StringSplitOptions.RemoveEmptyEntries);
var words = text.Split (ustring.Make (' '));
int textCount = words.Sum (arg => arg.RuneCount);
var spaces = words.Length > 1 ? (width - textCount) / (words.Length - 1) : 0;
var extras = words.Length > 1 ? (width - textCount) % words.Length : 0;
var s = new System.Text.StringBuilder ();
//s.Append ($"tc={textCount} sp={spaces},x={extras} - ");
for (int w = 0; w < words.Length; w++) {
var x = words [w];
s.Append (x);
@@ -302,7 +300,6 @@ namespace Terminal.Gui {
for (int i = 0; i < spaces; i++)
s.Append (spaceChar);
if (extras > 0) {
//s.Append ('_');
extras--;
}
}

View File

@@ -10,19 +10,9 @@ namespace UICatalog {
[ScenarioCategory ("Text")]
[ScenarioCategory ("POC")]
class TextFormatterDemo : Scenario {
//public override void Init (Toplevel top, ColorScheme colorScheme)
//{
// Application.Init ();
// Top = top;
// if (Top == null) {
// Top = Application.Top;
// }
// Win = null;
//}
public override void Setup ()
{
// TODO: Move this to another Scenario that specifically tests `Views` that have no subviews.
//Top.Text = "Press CTRL-Q to Quit. This is the Text for the TopLevel View. TextAlignment.Centered was specified. It is intentionally very long to illustrate word wrap.\n" +
// "<-- There is a new line here to show a hard line break. You should see this text bleed underneath the subviews, which start at Y = 3.";
//Top.TextAlignment = TextAlignment.Centered;

View File

@@ -1,2 +0,0 @@
Hello world.
This is a test of the Emergency Broadcast System.