1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-18 16:10:26 +02:00

Added mouseover docs support

This commit is contained in:
Brian Fiete 2020-09-25 08:50:39 -07:00
parent dc2603bc60
commit e02b42d6f4
5 changed files with 58 additions and 28 deletions

View file

@ -724,23 +724,20 @@ namespace IDE.ui
if (evalString.StartsWith(":", StringComparison.Ordinal))
{
var showString = scope String(evalString, 1);
int crPos = showString.IndexOf('\n');
if (crPos != -1)
bool isShowingDoc = showString.Contains('\x01');
if (!isShowingDoc)
{
val.Append("\n\n");
val.Append(showString, crPos + 1);
showString.RemoveToEnd(crPos);
int crPos = showString.IndexOf('\n');
if (crPos != -1)
{
val.Append("\n\n");
val.Append(showString, crPos + 1);
showString.RemoveToEnd(crPos);
}
}
useListViewItem.Label = showString;
isStringLiteral = true;
/*int lineCount = 0;
for (int i = 0; i < evalString.Length; i++)
if (evalString[i] == '\n')
lineCount++;
listViewItem.mBottomPadding = listView.mFont.GetLineSpacing() * lineCount; */
}
else
{

View file

@ -4852,6 +4852,24 @@ namespace IDE.ui
origDebugExpr.Set(debugExpr);
debugExpr.Set(resolveParams.mResultString);
if (debugExpr.StartsWith(':'))
{
int docsPos = debugExpr.IndexOf('\x03');
if (docsPos != -1)
{
String docs = scope String()..Append(debugExpr, docsPos + 1);
debugExpr.RemoveToEnd(docsPos);
DocumentationParser docParser = scope .(docs);
var showString = docParser.ShowDocString;
if (!String.IsNullOrEmpty(showString))
{
debugExpr.AppendF("\n{}", Font.EncodeColor(0xFFC0C0C0));
debugExpr.Append(showString);
}
}
}
}
if (!triedShow)