@@ 510,7 510,19 @@ namespace spawsh
string outString = DisplayBuffer[i].Replace("#", string.Empty);
Console.WriteLine(outString);
Console.ForegroundColor = originalColour;
- } else {
+ } else if (DisplayBuffer[i].Length > 3 && DisplayBuffer[i].Substring(0, 2) == "{l") {
+ string linkMetadata = DisplayBuffer[i].Split("}")[0];
+ string numberMetadata = linkMetadata.Replace("{l", string.Empty);
+ int thisLinkIndex = int.Parse(numberMetadata);
+
+ var originalColour = Console.ForegroundColor;
+ string outString = DisplayBuffer[i].Replace(linkMetadata + "}", string.Empty);
+ if (selectedLinkIndex == thisLinkIndex) {
+ Console.ForegroundColor = ConsoleColor.Blue;
+ }
+ Console.WriteLine(outString);
+ Console.ForegroundColor = originalColour;
+ }else {
Console.WriteLine(DisplayBuffer[i]);
}
}
@@ 522,6 534,7 @@ namespace spawsh
static void buildDisplayBuffer() {
string[] tempBuffer = new string[1024];
int currentPointer = 0;
+ int currentLink = 0;
foreach (string singleLine in LineBuffer) {
if (singleLine.Length < Console.WindowWidth)
@@ 536,13 549,14 @@ namespace spawsh
//then singleLine = singleLine.Replace(toRemove, "");
string linkAndDescription = singleLine.Substring(3);
if (linkAndDescription.Contains('\t')) {
- tempBuffer[currentPointer] = linkAndDescription.Split('\t')[1];
+ tempBuffer[currentPointer] = "{l" + currentLink + "}" + linkAndDescription.Split('\t')[1];
} else {
toRemove = linkAndDescription.Split(' ')[0];
linkAndDescription = linkAndDescription.Replace(toRemove, "");
- tempBuffer[currentPointer] = linkAndDescription;
+ tempBuffer[currentPointer] = "{l" + currentLink + "}" + linkAndDescription;
}
currentPointer++;
+ currentLink++;
} else {
tempBuffer[currentPointer] = singleLine;
currentPointer++;