1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Error checking for ShowCode

This commit is contained in:
Brian Fiete 2020-12-14 10:21:06 -08:00
parent 7ddd9a205d
commit c46e86f416

View file

@ -1054,15 +1054,17 @@ namespace IDE
if (var sourceViewPanel = GetActiveSourceViewPanel(true))
sourceViewPanel.RecordHistoryLocation();
int32 char8Idx = int32.Parse(cmds[2]).GetValueOrDefault();
int32 charIdx = int32.Parse(cmds[2]).GetValueOrDefault();
if (charIdx < 0)
return;
var sourceViewPanel = ShowSourceFile(cmds[1], null, SourceShowType.Temp);
if (sourceViewPanel == null)
return;
var editWidgetContent = sourceViewPanel.mEditWidget.mEditWidgetContent;
int line;
int lineChar;
editWidgetContent.GetLineCharAtIdx(char8Idx, out line, out lineChar);
sourceViewPanel.ShowFileLocation(char8Idx, .Always);
editWidgetContent.GetLineCharAtIdx(charIdx, out line, out lineChar);
sourceViewPanel.ShowFileLocation(charIdx, .Always);
case "ShowCodeAddr":
var sourceViewPanel = GetActiveSourceViewPanel(true);
if (sourceViewPanel != null)