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

Merge remote-tracking branch 'upstream/master' into Yuvan/CustomBuildProperties

This commit is contained in:
LAPTOP-NV8MPI8C\Yuvan Wickramasinghe 2025-03-28 14:48:45 -07:00
commit 4b879670ca
No known key found for this signature in database
294 changed files with 15180 additions and 4106 deletions

View file

@ -238,17 +238,11 @@ namespace IDE.ui
MarkDirty();
}
public override void KeyDown(KeyCode keyCode, bool isRepeat)
{
base.KeyDown(keyCode, isRepeat);
if ((keyCode == (.)'C') && (mWidgetWindow.GetKeyFlags(true) == .Ctrl))
{
String versionInfo = scope String();
versionInfo.AppendF("Beef IDE Version {}", gApp.mVersionInfo.FileVersion);
versionInfo.AppendF(" Build {}", gApp.mVersionInfo.ProductVersion);
gApp.SetClipboardText(versionInfo);
}
public override void GenerateClipboardText(String outText)
{
outText.AppendF("Beef IDE Version {}", gApp.mVersionInfo.FileVersion);
outText.AppendF(" Build {}", gApp.mVersionInfo.ProductVersion);
}
}
}

View file

@ -308,8 +308,8 @@ namespace IDE.ui
//Outline(g, mCategorySelector, 0, 0, 0xFF404040);
//Outline(g, mCategorySelector, -1, -1, 0xFF202020);
Outline(g, mFileList, 0, 0, IDEApp.cDialogOutlineLightColor);
Outline(g, mFileList, -1, -1, IDEApp.cDialogOutlineDarkColor);
Outline(g, mFileList, 0, 0, DarkTheme.COLOR_DIALOG_OUTLINE_OUT);
Outline(g, mFileList, -1, -1, DarkTheme.COLOR_DIALOG_OUTLINE_IN);
}
void CheckFileDates()

View file

@ -413,6 +413,11 @@ namespace IDE.ui
g.PushColor(DarkTheme.COLOR_MENU_FOCUSED);
defer:loop g.PopColor();
}
else
{
g.PushColor(DarkTheme.COLOR_TEXT);
defer:loop g.PopColor();
}
let str = StringView(mEntryDisplay, index, @c.NextIndex - index);
@ -512,9 +517,6 @@ namespace IDE.ui
public void UpdateWidth()
{
if (mWidgetWindow == null)
return;
int firstEntry = (int)(-(int)mScrollContent.mY / mItemSpacing);
int lastEntry = (int)((-(int)mScrollContent.mY + mScrollContentContainer.mHeight) / mItemSpacing);
@ -536,6 +538,8 @@ namespace IDE.ui
mMaxWidth = Math.Max(mMaxWidth, entryWidth);
}
if (mWidgetWindow == null)
return;
float docWidth = 0.0f;
float docHeight = 0;
@ -557,8 +561,8 @@ namespace IDE.ui
int drawScreenX = (.)(mWidgetWindow.mX + mWidth - mDocWidth);
gApp.GetWorkspaceRectFrom(drawScreenX, mWidgetWindow.mY, 0, 0, var workspaceX, var workspaceY, var workspaceWidth, var workspaceHeight);
float maxWidth = workspaceWidth - drawScreenX - GS!(8);
float newDocWidth = Math.Min(docWidth, workspaceWidth - drawScreenX - GS!(8));
float maxWidth = workspaceWidth - (drawScreenX - workspaceX) - GS!(8);
float newDocWidth = Math.Min(docWidth, workspaceWidth - (drawScreenX - workspaceX) - GS!(8));
newDocWidth = Math.Max(newDocWidth, GS!(80));
if ((docWidth > maxWidth) || (lineCount > 1))
{
@ -703,6 +707,8 @@ namespace IDE.ui
public void SelectDirection(int32 dir)
{
mAutoComplete.HasInteracted = true;
if (mEntryList.IsEmpty)
return;
int32 newSelection = mSelectIdx + dir;
@ -932,6 +938,9 @@ namespace IDE.ui
mWidth = extWidth;
mHeight = extHeight;
if ((mWidth <= 0) || (mHeight <= 0))
return;
if (resizeWindow)
{
if (mOwnsWindow)
@ -1069,8 +1078,12 @@ namespace IDE.ui
{
var font = IDEApp.sApp.mCodeFont;
extHeight = 0;
extWidth = 0;
if (mSelectIdx < 0)
return;
float curX = GS!(8);
float curY = GS!(5);
@ -1274,6 +1287,8 @@ namespace IDE.ui
float mWantX;
float mWantY;
public bool HasInteracted;
public this(EditWidget targetEditWidget)
{
mTargetEditWidget = targetEditWidget;
@ -1295,7 +1310,7 @@ namespace IDE.ui
var textIdx;
// This makes typing '..' NOT move the window after pressing the second '.'
if (mTargetEditWidget.Content.SafeGetChar(textIdx - 2) == '.')
if (mTargetEditWidget.Content.SafeGetChar(textIdx - 2) == '.')
{
textIdx--;
}
@ -1572,7 +1587,7 @@ namespace IDE.ui
mInsertStartIdx--;
}*/
if ((mInvokeWidget != null) && (mInvokeWidget.mEntryList.Count > 0))
if ((mInvokeWidget != null) && (mInvokeSrcPositions != null) && (mInvokeWidget.mEntryList.Count > 0))
{
var data = mTargetEditWidget.Content.mData;
@ -1807,7 +1822,7 @@ namespace IDE.ui
if (!fts_fuzzy_match(filter.CStr(), entry.mEntryDisplay.CStr(), ref score, &matches, matches.Count))
{
entry.SetMatches(Span<uint8>(null, 0));
entry.SetMatches(Span<uint8>((uint8*)null, 0));
entry.mScore = score;
return false;
}
@ -2032,7 +2047,7 @@ namespace IDE.ui
if (mInvokeWidget != null)
{
prevInvokeSelect = mInvokeWidget.mSelectIdx;
if ((mInvokeWidget.mEntryList.Count > 0) && (!mInvokeSrcPositions.IsEmpty))
if ((mInvokeWidget.mEntryList.Count > 0) && (mInvokeSrcPositions != null) && (!mInvokeSrcPositions.IsEmpty) && (mInvokeWidget.mSelectIdx >= 0))
{
if (IsInPanel())
{
@ -2042,8 +2057,11 @@ namespace IDE.ui
{
mInvokeWidget.mOwnsWindow = true;
mInvokeWidget.ResizeContent(false);
UpdateWindow(ref mInvokeWindow, mInvokeWidget, mInvokeSrcPositions[0], (int32)mInvokeWidget.mWidth, (int32)mInvokeWidget.mHeight);
mInvokeWidget.ResizeContent(true);
if ((mInvokeWidget.mWidth > 0) && (mInvokeWidget.mHeight > 0))
{
UpdateWindow(ref mInvokeWindow, mInvokeWidget, mInvokeSrcPositions[0], (int32)mInvokeWidget.mWidth, (int32)mInvokeWidget.mHeight);
mInvokeWidget.ResizeContent(true);
}
}
}
else
@ -2209,6 +2227,7 @@ namespace IDE.ui
}
contentHeight += GS!(8);
mAutoCompleteListWidget.ResizeContent(windowWidth, contentHeight, wantScrollbar);
//mAutoCompleteListWidget.UpdateWidth();
if ((mInsertStartIdx != -1) && (!IsInPanel()))
{
UpdateWindow(ref mListWindow, mAutoCompleteListWidget, mInsertStartIdx, windowWidth, windowHeight);
@ -2963,7 +2982,7 @@ namespace IDE.ui
return;
}
bool isExplicitInsert = (keyChar == '\0') || (keyChar == '\t') || (keyChar == '\n');
bool isExplicitInsert = (keyChar == '\0') || (keyChar == '\t') || (keyChar == '\n') || (keyChar == '\r');
String insertText = entry.mEntryInsert ?? entry.mEntryDisplay;
if ((!isExplicitInsert) && (insertText.Contains('\t')))
@ -2977,11 +2996,15 @@ namespace IDE.ui
//insertText = insertText.Substring(0, insertText.Length - 1);
String implText = null;
int tabIdx = insertText.IndexOf('\t');
if (tabIdx != -1)
int splitIdx = tabIdx;
int crIdx = insertText.IndexOf('\r');
if ((crIdx != -1) && (tabIdx != -1) && (crIdx < tabIdx))
splitIdx = crIdx;
if (splitIdx != -1)
{
implText = scope:: String();
implText.Append(insertText, tabIdx);
insertText.RemoveToEnd(tabIdx);
implText.Append(insertText, splitIdx);
insertText.RemoveToEnd(splitIdx);
}
String prevText = scope String();
mTargetEditWidget.Content.ExtractString(editSelection.mStartPos, editSelection.mEndPos - editSelection.mStartPos, prevText);

View file

@ -693,7 +693,7 @@ namespace IDE.ui
for (int32 c in scope int32[] ( 4, 8, 16, 32, 64 ))
{
columnChoice = menuItem.AddItem(StackStringFormat!("{0} bytes", c));
columnChoice = menuItem.AddItem(scope String()..AppendF("{0} bytes", c));
if ((mAutoResizeType == .Manual) && (c == (int32)mBytesPerDisplayLine))
columnChoice.mIconImage = DarkTheme.sDarkTheme.GetImage(DarkTheme.ImageIdx.Check);
columnChoice.mOnMenuItemSelected.Add(new (evt) =>
@ -877,15 +877,15 @@ namespace IDE.ui
// column header
using (g.PushClip(0, 0, mWidth, GS!(mColumnHeaderHeight)))
{
using (g.PushColor(0xFFFFFFFF))
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
g.SetFont(mFont);
float strViewColumnStart = GS!(mColumnDisplayStart) + mBytesPerDisplayLine*GS!(mColumnDisplayStride) + GS!(mStrViewDisplayStartOffset);
for (int i=0; i<mBytesPerDisplayLine; ++i)
{
g.DrawString(StackStringFormat!("{0:X1}", i), GS!(mColumnDisplayStart) + i*GS!(mColumnDisplayStride) + GS!(mColumnDisplayStride)*0.125f - ((i > 0xF) ? GS!(4) : 0), GS!(3), FontAlign.Left);
g.DrawString(StackStringFormat!("{0:X1}", i & 0xF), strViewColumnStart + i*GS!(mStrViewDisplayStride), GS!(3), FontAlign.Left);
g.DrawString(scope String()..AppendF("{0:X1}", i), GS!(mColumnDisplayStart) + i*GS!(mColumnDisplayStride) + GS!(mColumnDisplayStride)*0.125f - ((i > 0xF) ? GS!(4) : 0), GS!(3), FontAlign.Left);
g.DrawString(scope String()..AppendF("{0:X1}", i & 0xF), strViewColumnStart + i*GS!(mStrViewDisplayStride), GS!(3), FontAlign.Left);
}
}
}
@ -908,7 +908,7 @@ namespace IDE.ui
float displayAdj = (float)(-mShowPositionDisplayOffset * lineSpacing);
using (g.PushTranslate(0, displayAdj))
{
using (g.PushColor(0xFFFFFFFF))
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
//ulong lineStart = mCurPosition / mBytesPerDisplayLine;
int lockSize = lineCount * mBytesPerDisplayLine;

View file

@ -652,17 +652,15 @@ namespace IDE.ui
subItem.mOnMouseClick.Add(new => ListViewItemClicked);
}
var listViewItem = (BreakpointListViewItem)root.GetChildAtIndex(breakIdx);
listViewItem.mTextColor = Color.White;
listViewItem.mTextColor = DarkTheme.COLOR_TEXT;
listViewItem.mIsBold = breakpoint.IsActiveBreakpoint();
var locString = scope String();
breakpoint.ToString_Location(locString);
listViewItem.Label = locString;
if (breakpoint.IsBound())
listViewItem.mTextColor = 0xFFFFFFFF;
else
listViewItem.mTextColor = 0x80FFFFFF;
if (!breakpoint.IsBound())
listViewItem.mTextColor = (0x00FFFFFF & DarkTheme.COLOR_TEXT) | 0x80000000;
// Condition
var subItem = listViewItem.GetSubItem(2);

View file

@ -369,14 +369,17 @@ namespace IDE.ui
{
base.Draw(g);
g.DrawString("Breakpoint Condition", mConditionEdit.mX, mConditionEdit.mY - GS!(20));
g.DrawString("Thread Id", mThreadEdit.mX, mThreadEdit.mY - GS!(20));
g.DrawString("Log String", mLogEdit.mX, mLogEdit.mY - GS!(20));
g.DrawString("Break on Hit Count", mHitCountCombo.mX, mHitCountEdit.mY - GS!(19));
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
g.DrawString("Breakpoint Condition", mConditionEdit.mX, mConditionEdit.mY - GS!(20));
g.DrawString("Thread Id", mThreadEdit.mX, mThreadEdit.mY - GS!(20));
g.DrawString("Log String", mLogEdit.mX, mLogEdit.mY - GS!(20));
g.DrawString("Break on Hit Count", mHitCountCombo.mX, mHitCountEdit.mY - GS!(19));
var str = scope String();
str.AppendF("Current: {0}", mStartingHitCount);
g.DrawString(str, mWidth - GS!(16) - GS!(8), mHitCountEdit.mY - GS!(19), .Right);
var str = scope String();
str.AppendF("Current: {0}", mStartingHitCount);
g.DrawString(str, mWidth - GS!(16) - GS!(8), mHitCountEdit.mY - GS!(19), .Right);
}
}
}
}

View file

@ -255,7 +255,8 @@ namespace IDE.ui
{
using (g.PushClip(0, 0, width, height))
{
using (g.PushColor(0xFF00FF00))
// Using override to prevent the color turning black when using a dark text color.
using (g.PushColorOverride(0xFF00FF00))
{
float prevY = 0;
@ -439,10 +440,13 @@ namespace IDE.ui
using (g.PushColor(0x20FFFFFF))
g.FillRect(0, 0, mWidth, mHeight);
DrawData(g, mData, mTimes, dataRect.mX, dataRect.mY, dataRect.mWidth, dataRect.mHeight);
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
DrawData(g, mData, mTimes, dataRect.mX, dataRect.mY, dataRect.mWidth, dataRect.mHeight);
g.SetFont(DarkTheme.sDarkTheme.mSmallBoldFont);
g.DrawString(mLabel, -GS!(0), -GS!(0), .Centered, dataRect.mX);
g.SetFont(DarkTheme.sDarkTheme.mSmallBoldFont);
g.DrawString(mLabel, -GS!(0), -GS!(0), .Centered, dataRect.mX);
}
}
}

View file

@ -890,7 +890,7 @@ namespace IDE.ui
{
var lineData = mLineDatas[lineIdx];
if (lineData.mSourceFile != null)
g.DrawString(StackStringFormat!("{0}", lineData.mSourceLineNum + 1), GS!(8), GS!(2) + lineIdx * lineSpacing, FontAlign.Right, mEditWidget.mX - GS!(14));
g.DrawString(scope String()..AppendF("{0}", lineData.mSourceLineNum + 1), GS!(8), GS!(2) + lineIdx * lineSpacing, FontAlign.Right, mEditWidget.mX - GS!(14));
}
}
@ -1338,7 +1338,7 @@ namespace IDE.ui
{
if (mLineDatas[line].mAddrEnd != (int)0)
{
String nextAddr = StackStringFormat!("0x{0:x}L", (int64)mLineDatas[line].mAddrEnd);
String nextAddr = scope String()..AppendF("0x{0:x}L", (int64)mLineDatas[line].mAddrEnd);
nextAddr.Append(" +");
debugExpr.Replace("rip +", nextAddr);
}

View file

@ -26,6 +26,43 @@ namespace IDE.ui
public int mLine;
public int mColumn;
public override void MouseClicked(float x, float y, float origX, float origY, int32 btn)
{
base.MouseClicked(x, y, origX, origY, btn);
if (btn == 1)
{
Menu menu = new Menu();
var menuItemCopySingle = menu.AddItem("Copy");
menuItemCopySingle.mOnMenuItemSelected.Add(new (evt) =>
{
String buffer = scope .();
mListView.GetRoot().WithSelectedItems(scope (item) =>
{
var errorItem = (ErrorsListViewItem)item;
if (!buffer.IsEmpty)
buffer.Append("\n");
errorItem.CopyError(buffer);
});
if (!buffer.IsEmpty)
gApp.SetClipboardText(buffer);
});
MenuWidget menuWidget = DarkTheme.sDarkTheme.CreateMenuWidget(menu);
menuWidget.Init(this, x, y);
}
}
public void CopyError (String buffer)
{
var preffix = scope String();
Font.StrRemoveColors(this.mSubItems[0].mLabel, preffix);
preffix.ToUpper();
var description = this.mSubItems[1].mLabel;
buffer.AppendF("{}: {} at line {}:{} in {}", preffix, description, this.mLine, this.mColumn, this.mFilePath);
}
public override void DrawSelect(Graphics g)
{
bool hasFocus = mListView.mHasFocus;

View file

@ -67,7 +67,7 @@ namespace IDE.ui
AddDialogComponent(mMatchCaseCheckbox);
mMatchWholeWordCheckbox = new DarkCheckBox();
mMatchWholeWordCheckbox.Label = "Match &whole case";
mMatchWholeWordCheckbox.Label = "Match &whole word";
AddDialogComponent(mMatchWholeWordCheckbox);
mAbortButton = new DarkButton();
@ -322,11 +322,14 @@ namespace IDE.ui
{
base.Draw(g);
g.DrawString("Find what:", 6, mEditWidget.mY - GS!(18));
if (mReplaceWidget != null)
g.DrawString("Replace with:", GS!(6), mReplaceWidget.mY - GS!(18));
g.DrawString("Look in:", GS!(6), mLocationCombo.mY - GS!(18));
g.DrawString("Look at these file types:", GS!(6), mFileTypesCombo.mY - GS!(18));
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
g.DrawString("Find what:", 6, mEditWidget.mY - GS!(18));
if (mReplaceWidget != null)
g.DrawString("Replace with:", GS!(6), mReplaceWidget.mY - GS!(18));
g.DrawString("Look in:", GS!(6), mLocationCombo.mY - GS!(18));
g.DrawString("Look at these file types:", GS!(6), mFileTypesCombo.mY - GS!(18));
}
}
public override void Update()

View file

@ -185,9 +185,10 @@ namespace IDE.ui
char8* linePtr = line.Ptr;
bool lineMatched;
bool lineMatched = false;
if (mSearchOptions.mMatchWholeWord)
{
line.EnsureNullTerminator();
bool isNewStart = true;
int lineIdx = 0;
for (let c32 in line.DecodedChars)

View file

@ -581,12 +581,15 @@ namespace IDE.ui
uiEntry.mName = partItr.GetNext().Value.UnQuoteString(.. new .());
uiEntry.mLabel = partItr.GetNext().Value.UnQuoteString(.. new .());
var defaultValue = partItr.GetNext().Value.UnQuoteString(.. scope .());
var focus = partItr.GetNext().Value;
DarkEditWidget editWidget = new DarkEditWidget();
uiEntry.mWidget = editWidget;
editWidget.SetText(defaultValue);
editWidget.mEditWidgetContent.SelectAll();
editWidget.mOnSubmit.Add(new => EditSubmitHandler);
AddWidget(editWidget);
if (focus == "True")
editWidget.SetFocus();
mUIEntries.Add(uiEntry);
mTabWidgets.Add(editWidget);
case "addFilePath", "addFolderPath":
@ -834,9 +837,12 @@ namespace IDE.ui
g.DrawString(label, widget.mX + GS!(6), widget.mY - GS!(20));
}
DrawLabel(mKindBar, mRegenerating ? "Regenerating ..." : "Generator");
for (var uiEntry in mUIEntries)
DrawLabel(uiEntry.mWidget, uiEntry.mLabel);
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
DrawLabel(mKindBar, mRegenerating ? "Regenerating ..." : "Generator");
for (var uiEntry in mUIEntries)
DrawLabel(uiEntry.mWidget, uiEntry.mLabel);
}
}
public override void DrawAll(Graphics g)

View file

@ -37,7 +37,7 @@ namespace IDE.ui
mDefaultButton = AddButton("OK", new (evt) => GotoLineSubmit(true));
mEscButton = AddButton("Cancel", new (evt) => Cancel());
mEditWidget = AddEdit(StackStringFormat!("{0}", line + 1));
mEditWidget = AddEdit(scope String()..AppendF("{0}", line + 1));
mEditWidget.mOnContentChanged.Add(new (evt) => GotoLineSubmit(false));
}

View file

@ -775,7 +775,7 @@ namespace IDE.ui
flags |= DebugManager.EvalExpressionFlags.DeselectCallStackIdx;
if (mAllowSideEffects)
flags |= .AllowSideEffects | .AllowCalls;
if (gApp.mSettings.mDebuggerSettings.mAutoEvaluateProperties)
if (gApp.mSettings.mDebuggerSettings.mAutoEvaluatePropertiesOnHover)
flags |= .AllowProperties;
if (watch.mResultType == .RawText)
flags |= .RawStr;
@ -1311,6 +1311,7 @@ namespace IDE.ui
float addHeight = nameHeight - listViewItem.mSelfHeight;
listViewItem.mSelfHeight = nameHeight;
listViewItem.mFreezeHeight = true;
height += addHeight;
}
@ -1322,6 +1323,8 @@ namespace IDE.ui
height += GS!(2);
listView.Resize(popupX, popupY, useWidth, height);
listView.mListSizeDirty = true;
listView.UpdateListSize();
ResizeWindow();
}

View file

@ -140,7 +140,8 @@ namespace IDE.ui
{
base.Draw(g);
g.DrawString((mBreakpointKind == .Memory) ? "Breakpoint Address" : "Symbol Name", mAddressEdit.mX, mAddressEdit.mY - GS!(20));
using (g.PushColor(DarkTheme.COLOR_TEXT))
g.DrawString((mBreakpointKind == .Memory) ? "Breakpoint Address" : "Symbol Name", mAddressEdit.mX, mAddressEdit.mY - GS!(20));
//g.DrawString("Project Directory", mDialogEditWidget.mX, mDialogEditWidget.mY - 20);
}

View file

@ -119,7 +119,7 @@ namespace IDE.ui
String projectFilePath = scope String()..Append(projDirectory, "/BeefProj.toml");
if (File.Exists(projectFilePath))
{
gApp.Fail(scope String()..AppendF("A Beef projects already exists at '{0}'", projDirectory));
gApp.Fail(scope String()..AppendF("A Beef project already exists at '{0}'", projDirectory));
return false;
}

View file

@ -365,8 +365,8 @@ namespace IDE.ui
//Outline(g, mCategorySelector, 0, 0, 0xFF404040);
//Outline(g, mCategorySelector, -1, -1, 0xFF202020);
Outline(g, mFileList, 0, 0, IDEApp.cDialogOutlineLightColor);
Outline(g, mFileList, -1, -1, IDEApp.cDialogOutlineDarkColor);
Outline(g, mFileList, 0, 0, DarkTheme.COLOR_DIALOG_OUTLINE_OUT);
Outline(g, mFileList, -1, -1, DarkTheme.COLOR_DIALOG_OUTLINE_IN);
}
void CheckFileDates()

View file

@ -287,7 +287,7 @@ namespace IDE.ui
public void WriteSmart(StringView text)
{
for (var line in text.Split('\n'))
LineLoop: for (var line in text.Split('\n'))
{
if (@line.Pos != 0)
Write("\n");
@ -302,10 +302,21 @@ namespace IDE.ui
mQueuedDisplayChanges.Add(QueuedDisplayChange(mQueuedText.Length, "ERROR".Length, (.)SourceElementType.BuildError));
}
if (line.StartsWith("ERROR-SOFT:"))
{
var str = scope:LineLoop String(line);
str.Replace("ERROR-SOFT", "ERROR");
line = str;
mQueuedDisplayChanges.Add(QueuedDisplayChange(mQueuedText.Length, "ERROR".Length, (.)SourceElementType.BuildError));
}
if ((line.StartsWith("WARNING:")) || (line.StartsWith("WARNING(")))
{
mQueuedDisplayChanges.Add(QueuedDisplayChange(mQueuedText.Length, "WARNING".Length, (.)SourceElementType.BuildWarning));
}
if (line.StartsWith("SUCCESS:"))
{
mQueuedDisplayChanges.Add(QueuedDisplayChange(mQueuedText.Length, "SUCCESS".Length, (.)SourceElementType.BuildSuccess));
}
Write(line);
}
}

View file

@ -141,7 +141,7 @@ namespace IDE.ui
var editWidget = new WatchStringEdit(mTooltipText, null);
tooltip.mRelWidgetMouseInsets = new Insets(0, 0, GS!(-8), 0);
tooltip.mAllowMouseInsideSelf = true;
tooltip.mAllowMouseInsideInsets = new .();
tooltip.AddWidget(editWidget);
tooltip.mOnResized.Add(new (widget) => editWidget.Resize(GS!(6), GS!(6), widget.mWidth - GS!(6) * 2, widget.mHeight - GS!(6) * 2));
tooltip.mOnResized(tooltip);

View file

@ -95,9 +95,12 @@ namespace IDE.ui
{
base.Draw(g);
DrawLabel(g, mDescEdit, "Profile Description (Optional)");
DrawLabel(g, mThreadCombo, "Thread");
DrawLabel(g, mSampleRateEdit, "Sample Rate");
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
DrawLabel(g, mDescEdit, "Profile Description (Optional)");
DrawLabel(g, mThreadCombo, "Thread");
DrawLabel(g, mSampleRateEdit, "Sample Rate");
}
}
public override void CalcSize()

View file

@ -684,24 +684,27 @@ namespace IDE.ui
{
base.Draw(g);
g.PushColor(DarkTheme.COLOR_TEXT);
defer g.PopColor();
g.SetFont(DarkTheme.sDarkTheme.mSmallFont);
g.DrawString("Session", mSessionComboBox.mX - GS!(2), mSessionComboBox.mY, .Right);
g.DrawString("Thread", mThreadComboBox.mX - GS!(2), mThreadComboBox.mY, .Right);
if ((mProfiler != null) && (mShowOverview != null))
{
g.DrawString(StackStringFormat!("Rate: {0} Hz", mShowOverview.mSamplesPerSecond), GS!(320), GS!(2));
g.DrawString(scope String()..AppendF("Rate: {0} Hz", mShowOverview.mSamplesPerSecond), GS!(320), GS!(2));
int32 seconds = (mShowOverview.mRecordedTicks / 1000);
g.DrawString(StackStringFormat!("Length: {0}:{1:00}.{2}", seconds / 60, seconds % 60, (mShowOverview.mRecordedTicks % 1000)/100), GS!(320), GS!(22));
g.DrawString(scope String()..AppendF("Length: {0}:{1:00}.{2}", seconds / 60, seconds % 60, (mShowOverview.mRecordedTicks % 1000)/100), GS!(320), GS!(22));
seconds = (mShowOverview.mEndedTicks / 1000);
if (seconds > 60*60)
g.DrawString(StackStringFormat!("Age: {0}:{1:00}:{2:00}", seconds / 60 / 60, (seconds / 60) % 60, seconds % 60), GS!(420), GS!(22));
g.DrawString(scope String()..AppendF("Age: {0}:{1:00}:{2:00}", seconds / 60 / 60, (seconds / 60) % 60, seconds % 60), GS!(420), GS!(22));
else
g.DrawString(StackStringFormat!("Age: {0}:{1:00}", seconds / 60, seconds % 60), GS!(420), GS!(22));
g.DrawString(scope String()..AppendF("Age: {0}:{1:00}", seconds / 60, seconds % 60), GS!(420), GS!(22));
g.DrawString(StackStringFormat!("Samples: {0}", mShowOverview.mTotalActualSamples), GS!(420), GS!(2));
g.DrawString(StackStringFormat!("Missed Samples: {0}", mShowOverview.mTotalVirtualSamples - mShowOverview.mTotalActualSamples), GS!(550), GS!(2));
g.DrawString(scope String()..AppendF("Samples: {0}", mShowOverview.mTotalActualSamples), GS!(420), GS!(2));
g.DrawString(scope String()..AppendF("Missed Samples: {0}", mShowOverview.mTotalVirtualSamples - mShowOverview.mTotalActualSamples), GS!(550), GS!(2));
}
if (mTickCreated != 0)

View file

@ -1257,9 +1257,9 @@ namespace IDE.ui
{
String errorStr;
if (alreadyHadFileList.Count == 1)
errorStr = StackStringFormat!("Project already contained file: {0}", alreadyHadFileList[0]);
errorStr = scope:: String()..AppendF("Project already contained file: {0}", alreadyHadFileList[0]);
else
errorStr = StackStringFormat!("Project already contained {0} of the {1} files specified", alreadyHadFileList.Count, totalFileCount);
errorStr = scope:: String()..AppendF("Project already contained {0} of the {1} files specified", alreadyHadFileList.Count, totalFileCount);
IDEApp.sApp.Fail(errorStr);
}
}
@ -1991,7 +1991,7 @@ namespace IDE.ui
if (projectCount == 1)
{
aDialog = ThemeFactory.mDefault.CreateDialog("Remove Project", StackStringFormat!("Remove project '{0}' from the workspace?", selectedProjectItem.mProject.mProjectName));
aDialog = ThemeFactory.mDefault.CreateDialog("Remove Project", scope String()..AppendF("Remove project '{0}' from the workspace?", selectedProjectItem.mProject.mProjectName));
}
else
{
@ -2009,7 +2009,7 @@ namespace IDE.ui
if (fileCount + folderCount == 1)
{
aDialog = ThemeFactory.mDefault.CreateDialog((fileCount > 0) ? "Delete File" : "Delete Folder",
StackStringFormat!("Choose Remove to remove '{0}' from '{1}'.\n\nChoose Delete to permanently delete '{0}'.", selectedProjectItem.mName, selectedProjectItem.mProject.mProjectName));
scope String()..AppendF("Choose Remove to remove '{0}' from '{1}'.\n\nChoose Delete to permanently delete '{0}'.", selectedProjectItem.mName, selectedProjectItem.mProject.mProjectName));
}
else
{
@ -2034,12 +2034,12 @@ namespace IDE.ui
if (projectsReferenced.Count == 1)
{
aDialog = ThemeFactory.mDefault.CreateDialog(title,
StackStringFormat!("Choose Remove to remove the selected {0} from '{1}'.\n\nChoose Delete to permanently delete the selected items.", typeDeleting, selectedProjectItem.mProject.mProjectName));
scope String()..AppendF("Choose Remove to remove the selected {0} from '{1}'.\n\nChoose Delete to permanently delete the selected items.", typeDeleting, selectedProjectItem.mProject.mProjectName));
}
else
{
aDialog = ThemeFactory.mDefault.CreateDialog(title,
StackStringFormat!("Choose Remove to removed the selected {0}.\n\nChoose Delete to permanently delete the selected items.", typeDeleting));
scope String()..AppendF("Choose Remove to removed the selected {0}.\n\nChoose Delete to permanently delete the selected items.", typeDeleting));
}
}
@ -2580,7 +2580,7 @@ namespace IDE.ui
/*if ((IDEApp.IsBeefFile(prevPath) != IDEApp.IsBeefFile(newPath)) ||
(IDEApp.IsClangSourceFile(prevPath) != IDEApp.IsClangSourceFile(newPath)))
{
IDEApp.sApp.Fail(StackStringFormat!("Invalid file extension change, cannot rename '{0}' to '{1}'", prevPath, newPath));
IDEApp.sApp.Fail(scope String()..AppendF("Invalid file extension change, cannot rename '{0}' to '{1}'", prevPath, newPath));
return;
}*/
@ -2798,7 +2798,7 @@ namespace IDE.ui
if (!File.Exists(filePath))
{
gApp.Fail(StackStringFormat!("Project file not found: {0}", filePath));
gApp.Fail(scope String()..AppendF("Project file not found: {0}", filePath));
return null;
}
@ -2823,7 +2823,7 @@ namespace IDE.ui
Path.GetFileNameWithoutExtension(filePath, projName);
if (gApp.mWorkspace.FindProject(projName) != null)
{
gApp.Fail(StackStringFormat!("A project named '{0}' name already exists in the workspace.", projName));
gApp.Fail(scope String()..AppendF("A project named '{0}' name already exists in the workspace.", projName));
return null;
}
@ -2841,7 +2841,7 @@ namespace IDE.ui
InitProject(proj, workspaceFolder);
if (failed)
{
gApp.Fail(StackStringFormat!("Failed to load project: {0}", filePath));
gApp.Fail(scope String()..AppendF("Failed to load project: {0}", filePath));
return proj;
}

View file

@ -884,7 +884,7 @@ namespace IDE.ui
if (projectSpec.mVerSpec case .Git(let url, let ver))
{
dependencyEntry.SetValue(1, url);
dependencyEntry.SetValue(2, ver.mVersion);
dependencyEntry.SetValue(2, ver?.mVersion);
}
}
}

View file

@ -195,6 +195,7 @@ namespace IDE.ui
None,
BrowseForFile,
BrowseForFolder,
Percent
}
public enum MultiEncodeKind
@ -1036,8 +1037,10 @@ namespace IDE.ui
}
else if (curVariantType.[Friend]mTypeCode == .Float)
{
if (float.Parse(newValue) case .Ok(let floatVal))
if (float.Parse(newValue) case .Ok(var floatVal))
{
if (editingProp.mFlags.HasFlag(.Percent))
floatVal /= 100;
editingProp.mCurValue = Variant.Create(floatVal);
}
else
@ -1536,7 +1539,7 @@ namespace IDE.ui
}
if (i < strVals.Count)
{
childItem.Label = StackStringFormat!("#{0}", i + 1);
childItem.Label = scope String()..AppendF("#{0}", i + 1);
childSubItem.mTextColor = DarkTheme.COLOR_TEXT;
}
else
@ -1600,6 +1603,8 @@ namespace IDE.ui
{
let valStr = scope String();
float floatVal = propEntry.mCurValue.Get<float>();
if (propEntry.mFlags.HasFlag(.Percent))
floatVal *= 100;
floatVal.ToString(valStr);
valueItem.Label = valStr;
}
@ -2042,7 +2047,7 @@ namespace IDE.ui
let width = GetValueEditWidth(subItem);
propEntry.mEditInsets.mRight = GS!(22);
browseButton.mLabelYOfs = GS!(-2);
browseButton.Resize(width - GS!(21), GS!(1), GS!(20), subItem.mHeight - 2);
browseButton.Resize(width - GS!(21), GS!(1), GS!(20), Math.Max(subItem.mHeight - 2, 0));
});
subItem.AddWidget(browseButton);

View file

@ -182,7 +182,7 @@ namespace IDE.ui
mEditWidget.SetFocus();
replaceCount = Replace(true);
if (replaceCount > 0)
IDEApp.sApp.MessageDialog("Replace Results", StackStringFormat!("{0} instance(s) replaced.", replaceCount));
IDEApp.sApp.MessageDialog("Replace Results", scope String()..AppendF("{0} instance(s) replaced.", replaceCount));
if (replaceCount != -1)
{

View file

@ -367,11 +367,7 @@ namespace IDE.ui
{
String lineStr = scope String();
editWidgetContent.ExtractString(lineStart, idx - lineStart, lineStr);
//String fileName = editData.mFilePath;
//String fileName = scope String();
//projectSource.GetFullImportPath(fileName);
lineStr.Trim();
gApp.mFindResultsPanel.QueueLine(editData, lineNum, 0, lineStr);
wantsLine = false;
@ -719,7 +715,7 @@ namespace IDE.ui
editWidgetContent.mData.mUndoManager.Add(insertTextAction);
editWidgetContent.PhysInsertAtCursor(newStr, false);
if (spanStart <= cursorPos)
if (spanStart + strLenDiff <= cursorPos)
cursorPos += strLenDiff;
}

View file

@ -98,6 +98,7 @@ namespace IDE.ui
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
AddPropertiesItem(category, "Font", "mFonts");
AddPropertiesItem(category, "Font Size", "mFontSize");
AddPropertiesItem(category, "Line Height Scale", "mLineHeightScale", null, .Percent);
AddPropertiesItem(category, "Autocomplete", "mAutoCompleteShowKind");
AddPropertiesItem(category, "Autocomplete Require Control", "mAutoCompleteRequireControl");
AddPropertiesItem(category, "Autocomplete Require Tab", "mAutoCompleteRequireTab");
@ -347,7 +348,8 @@ namespace IDE.ui
AddPropertiesItem(root, "Symbol File Locations", "mSymbolSearchPath");
AddPropertiesItem(root, "Auto Find Paths", "mAutoFindPaths");
AddPropertiesItem(root, "Profile Sample Rate", "mProfileSampleRate");
AddPropertiesItem(root, "Auto Evaluate Properties", "mAutoEvaluateProperties");
AddPropertiesItem(root, "Auto Eval Properties on Hover", "mAutoEvaluatePropertiesOnHover");
AddPropertiesItem(root, "Auto Refresh Side Effects", "mAutoRefreshWatches");
}
protected override void ResetSettings()

View file

@ -1,3 +1,4 @@
#pragma warning disable 168
using System;
using System.Collections;
using System.Text;
@ -806,6 +807,7 @@ namespace IDE.ui
0xFFFF8080, // BuildError
0xFFFFFF80, // BuildWarning
0xFF80FF80, // BuildSuccess
0xFF9090C0, // VisibleWhiteSpace
) ~ delete _;
@ -856,6 +858,7 @@ namespace IDE.ui
SetFont(IDEApp.sApp.mCodeFont, true, true);
//SetFont(DarkTheme.sDarkTheme.mSmallFont, false, false);
mLineHeightScale = Math.Clamp(gApp.mSettings.mEditorSettings.mLineHeightScale, 0.125f, 10.0f);
mWantsTabsAsSpaces = gApp.mSettings.mEditorSettings.mTabsOrSpaces == .Spaces;
mTabLength = gApp.mSettings.mEditorSettings.mTabSize;
mTabSize = mFont.GetWidth(scope String(' ', gApp.mSettings.mEditorSettings.mTabSize));
@ -1209,11 +1212,12 @@ namespace IDE.ui
if ((flags & ~(uint8)SourceElementFlags.Skipped) == 0)
return;
let lineSpacing = LineHeight;
if ((flags & (uint8)SourceElementFlags.SymbolReference) != 0)
{
bool isRenameSymbol = (IDEApp.sApp.mSymbolReferenceHelper != null) && (IDEApp.sApp.mSymbolReferenceHelper.mKind == SymbolReferenceHelper.Kind.Rename);
using (g.PushColor(isRenameSymbol ? (uint32)0x28FFFFFF : (uint32)0x18FFFFFF))
g.FillRect(x, y, width, mFont.GetLineSpacing());
g.FillRect(x, y, width, lineSpacing);
DrawSectionFlagsOver(g, x, y, width, (uint8)(flags & ~(uint8)SourceElementFlags.SymbolReference));
return;
@ -1222,7 +1226,7 @@ namespace IDE.ui
if ((flags & (uint8)SourceElementFlags.Find_CurrentSelection) != 0)
{
using (g.PushColor(0x504C575C))
g.FillRect(x, y, width, mFont.GetLineSpacing());
g.FillRect(x, y, width, lineSpacing);
DrawSectionFlagsOver(g, x, y, width, (uint8)(flags & ~(uint8)(SourceElementFlags.Find_CurrentSelection | .Find_Matches)));
return;
@ -1231,7 +1235,7 @@ namespace IDE.ui
if ((flags & (uint8)SourceElementFlags.Find_Matches) != 0)
{
using (g.PushColor(0x50D0C090))
g.FillRect(x, y, width, mFont.GetLineSpacing());
g.FillRect(x, y, width, lineSpacing);
DrawSectionFlagsOver(g, x, y, width, (uint8)(flags & ~(uint8)SourceElementFlags.Find_Matches));
return;
@ -1275,7 +1279,7 @@ namespace IDE.ui
if (underlineColor != 0)
{
using (g.PushColor(underlineColor))
gApp.DrawSquiggle(g, x, y, width);
gApp.DrawSquiggle(g, x, y + GetTextOffset(), width);
}
}
}
@ -3015,6 +3019,7 @@ namespace IDE.ui
didLineComment = false;
lineStartCol = 0;
int appendedCount = 0;
for (int i = minPos; i < maxPos; i++)
{
var c = mData.mText[i].mChar;
@ -3052,6 +3057,8 @@ namespace IDE.ui
InsertAtCursor(str);
didLineComment = true;
maxPos += str.Length;
if (i <= startTextPos + appendedCount)
appendedCount += str.Length;
}
}
mSelection = EditSelection(minPos, maxPos);
@ -3059,7 +3066,10 @@ namespace IDE.ui
if (undoBatchStart != null)
mData.mUndoManager.Add(undoBatchStart.mBatchEnd);
CursorLineAndColumn = startLineAndCol;
if (appendedCount > 0)
CursorTextPos = startTextPos + appendedCount;
else
CursorLineAndColumn = startLineAndCol;
if (!hadSelection)
mSelection = null;
@ -3889,7 +3899,10 @@ namespace IDE.ui
}
else if (c == '.')
{
doAutocomplete = true;
if (mAutoComplete?.HasInteracted == true)
{
doAutocomplete = true;
}
}
}
}
@ -4188,8 +4201,10 @@ namespace IDE.ui
//int cursorTextPos = CursorTextPos;
if (cursorTextPos < mData.mTextLength)
{
charUnderCursor = (char8)mData.mText[cursorTextPos].mChar;
cursorInOpenSpace = ((charUnderCursor == ')') || (charUnderCursor == ']') || (charUnderCursor == ';') || (charUnderCursor == (char8)0) || (charUnderCursor.IsWhiteSpace));
let charData = mData.mText[cursorTextPos];
let cursorInLiteral = (SourceElementType)charData.mDisplayTypeId == .Literal;
charUnderCursor = (char8)charData.mChar;
cursorInOpenSpace = ((!cursorInLiteral) && ((charUnderCursor == ')') || (charUnderCursor == ']') || (charUnderCursor == ';') || (charUnderCursor == (char8)0) || (charUnderCursor.IsWhiteSpace)));
if (((keyChar == '(') && (charUnderCursor == ')')) ||
((keyChar == '[') && (charUnderCursor == ']')))
@ -4224,7 +4239,7 @@ namespace IDE.ui
}
else
{
if ((keyChar == '"') || (keyChar == '\''))
if ((!cursorInLiteral) && ((keyChar == '"') || (keyChar == '\'')))
cursorInOpenSpace = true;
}
}
@ -5077,7 +5092,7 @@ namespace IDE.ui
int callInstLoc = (int)int64.Parse(callInstLocStr, System.Globalization.NumberStyles.HexNumber);
if (callData.Count == 1)
{
callMenuItem = stepIntoSpecificMenu.AddItem(StackStringFormat!("Indirect call at 0x{0:X}", callInstLoc));
callMenuItem = stepIntoSpecificMenu.AddItem(scope String()..AppendF("Indirect call at 0x{0:X}", callInstLoc));
}
else
{
@ -5175,6 +5190,33 @@ namespace IDE.ui
}
}
void SetCollapseLineOpen(int line, bool wantOpen, bool includeChildren)
{
List<int32> collapseOpenList = scope .();
CollapseEntry* parentCollapse = null;
for (var collapse in mOrderedCollapseEntries)
{
if (parentCollapse == null)
{
if (collapse.mAnchorLine == line)
{
parentCollapse = collapse;
collapseOpenList.Add((.)@collapse.Index);
if (!includeChildren)
break;
}
}
else if ((collapse.mAnchorLine >= parentCollapse.mStartLine) && (collapse.mAnchorLine < parentCollapse.mEndLine))
{
collapseOpenList.Add((.)@collapse.Index);
}
}
for (int32 collapseIdx in collapseOpenList)
SetCollapseOpen(collapseIdx, wantOpen);
}
public override void MouseDown(float x, float y, int32 btn, int32 btnCount)
{
int line = GetLineAt(y);
@ -5187,10 +5229,13 @@ namespace IDE.ui
embed.MouseDown(GetEmbedRect(line, embed), x, y, btn, btnCount);
if (btn == 0)
{
if (btnCount % 2 == 0)
bool hasCtrl = mWidgetWindow.IsKeyDown(.Control);
if ((btnCount % 2 == 0) || (hasCtrl))
{
if (var collapseSummary = embed as SourceEditWidgetContent.CollapseSummary)
SetCollapseOpen(collapseSummary.mCollapseIndex, true);
{
SetCollapseLineOpen(line, true, hasCtrl);
}
else if (var emitEmbed = embed as EmitEmbed)
{
emitEmbed.mIsOpen = !emitEmbed.mIsOpen;
@ -5198,6 +5243,28 @@ namespace IDE.ui
}
}
}
else if (btn == 1)
{
float useX = x;
float useY = y;
Menu menu = new Menu();
var menuItem = menu.AddItem("Expand");
menuItem.mOnMenuItemSelected.Add(new (evt) =>
{
SetCollapseLineOpen(line, true, false);
});
menuItem = menu.AddItem("Expand All|Ctrl+Click");
menuItem.mOnMenuItemSelected.Add(new (evt) =>
{
SetCollapseLineOpen(line, true, true);
});
MenuWidget menuWidget = DarkTheme.sDarkTheme.CreateMenuWidget(menu);
menuWidget.Init(this, useX, useY);
}
return;
}
}
@ -5794,7 +5861,7 @@ namespace IDE.ui
}
orderedEmitEmbeds.Sort(scope (lhs, rhs) => lhs.line <=> rhs.line);
float fontHeight = mFont.GetLineSpacing();
float fontHeight = LineHeight;
int prevJumpIdx = -1;
float jumpCoordSpacing = GetJumpCoordSpacing();
@ -6373,8 +6440,10 @@ namespace IDE.ui
let height = mFont.GetHeight() + GS!(2);
using (g.PushColor(DarkTheme.COLOR_CHAR_PAIR_HILITE))
{
g.FillRect(x1, y1, charWidth, height);
g.FillRect(x2, y2, charWidth, height);
float offset = GetTextOffset();
g.FillRect(x1, y1 + offset, charWidth, height);
g.FillRect(x2, y2 + offset, charWidth, height);
}
}
}
@ -6543,7 +6612,6 @@ namespace IDE.ui
}
}
public void SetCollapseOpen(int collapseIdx, bool wantOpen, bool immediate = false, bool keepCursorVisible = false)
{
var entry = mOrderedCollapseEntries[collapseIdx];

View file

@ -47,6 +47,7 @@ namespace IDE.ui
BuildError,
BuildWarning,
BuildSuccess,
VisibleWhiteSpace
}
@ -95,7 +96,7 @@ namespace IDE.ui
base.MouseDown(x, y, btn, btnCount);
}
public override void MouseWheel(float x, float y, float deltaX, float deltaY)
public override void MouseWheel(MouseEvent evt)
{
var sewc = mEditWidgetContent as SourceEditWidgetContent;
if ((sewc.mSourceViewPanel != null) && (sewc.mSourceViewPanel.mEmbedParent != null))
@ -104,19 +105,26 @@ namespace IDE.ui
{
if ((mVertScrollbar != null) && (mVertScrollbar.mAllowMouseWheel))
{
mVertScrollbar.MouseWheel(x, y, 0, deltaY);
mVertScrollbar.MouseWheel(evt.mX, evt.mY, evt.mWheelDeltaX, evt.mWheelDeltaY);
return;
}
}
var target = sewc.mSourceViewPanel.mEmbedParent.mEditWidget.mEditWidgetContent;
SelfToOtherTranslate(target, x, y, var transX, var transY);
target.MouseWheel(transX, transY, deltaX, deltaY);
MouseEvent parentEvt = scope .();
parentEvt.mWheelDeltaX = evt.mWheelDeltaX;
parentEvt.mWheelDeltaY = evt.mWheelDeltaY;
parentEvt.mSender = evt.mSender;
// Keep passing it up until some is interested in using it...
SelfToOtherTranslate(target, evt.mX, evt.mY, out parentEvt.mX, out parentEvt.mY);
target.MouseWheel(evt);
return;
}
base.MouseWheel(x, y, deltaX, deltaY);
base.MouseWheel(evt);
}
public override void GotFocus()
@ -3809,7 +3817,7 @@ namespace IDE.ui
var text = scope String();
if (gApp.LoadTextFile(mFilePath, text) case .Err)
{
gApp.Fail(StackStringFormat!("Failed to open file '{0}'", mFilePath));
gApp.Fail(scope String()..AppendF("Failed to open file '{0}'", mFilePath));
return;
}
@ -4542,7 +4550,7 @@ namespace IDE.ui
{
float editX = GetEditX();
float lineSpacing = ewc.mFont.GetLineSpacing();
float lineSpacing = ewc.LineHeight;
int cursorLineNumber = mEditWidget.mEditWidgetContent.CursorLineAndColumn.mLine;
bool hiliteCurrentLine = mEditWidget.mHasFocus;
@ -4711,6 +4719,8 @@ namespace IDE.ui
}*/
}
float offset = ewc.GetTextOffset();
if ((gApp.mSettings.mEditorSettings.mShowLineNumbers) && (mEmbedKind == .None))
{
String lineStr = scope String(16);
@ -4739,7 +4749,8 @@ namespace IDE.ui
case 2: lineStr.AppendF("{0}", (lineIdx + 1) % 100);
default: lineStr.AppendF("{0}", lineIdx + 1);
}
g.DrawString(lineStr, 0, GS!(2) + ewc.mLineCoords[lineIdx], FontAlign.Right, editX - GS!(14));
using (g.PushColor(DarkTheme.COLOR_TEXT))
g.DrawString(lineStr, 0, GS!(2) + ewc.mLineCoords[lineIdx] + offset, FontAlign.Right, editX - GS!(14));
}
}
}
@ -4778,7 +4789,7 @@ namespace IDE.ui
{
using (g.PushColor(0xFFA5A5A5))
{
g.FillRect(editX - (int)GS!(7.5f), ewc.mLineCoords[lineIdx] - (int)GS!(0.5f), (int)GS!(1.5f), lineSpacing);
g.FillRect(editX - (int)GS!(7.5f), ewc.mLineCoords[lineIdx] - offset - (int)GS!(0.5f), (int)GS!(1.5f), lineSpacing + offset);
g.FillRect(editX - (int)GS!(7.5f), ewc.mLineCoords[lineIdx] + lineSpacing - (int)GS!(1.5f), GS!(5), (int)GS!(1.5f));
}
}
@ -4850,7 +4861,7 @@ namespace IDE.ui
mLinePointerDrawData.mUpdateCnt = gApp.mUpdateCnt;
mLinePointerDrawData.mDebuggerContinueIdx = gApp.mDebuggerContinueIdx;
g.Draw(img, mEditWidget.mX - GS!(20) - sDrawLeftAdjust,
0 + ewc.GetLineY(lineNum, 0));
0 + ewc.GetLineY(lineNum, 0) + ewc.GetTextOffset());
}
if (mMousePos != null && mIsDraggingLinePointer)
@ -4860,7 +4871,7 @@ namespace IDE.ui
{
using (g.PushColor(0x7FFFFFFF))
g.Draw(img, mEditWidget.mX - GS!(20) - sDrawLeftAdjust,
0 + ewc.GetLineY(dragLineNum, 0));
0 + ewc.GetLineY(dragLineNum, 0) + ewc.GetTextOffset());
}
}
}
@ -5121,10 +5132,16 @@ namespace IDE.ui
if (!mIsBeefSource)
return;
var bfSystem = IDEApp.sApp.mBfResolveSystem;
var bfSystem = IDEApp.sApp.mBfResolveSystem;
if (bfSystem == null)
return;
var parser = bfSystem.CreateEmptyParser(null);
let projectSource = FilteredProjectSource;
BfProject bfProject = null;
if ((projectSource != null) && (mIsBeefSource))
{
bfProject = bfSystem.GetBfProject(projectSource.mProject);
}
var parser = bfSystem.CreateEmptyParser(bfProject);
defer delete parser;
var text = scope String();
mEditWidget.GetText(text);
@ -5179,7 +5196,7 @@ namespace IDE.ui
public void GotoLine()
{
GoToLineDialog aDialog = new GoToLineDialog("Go To Line", StackStringFormat!("Line Number ({0}-{1})", 1, mEditWidget.Content.GetLineCount()));
GoToLineDialog aDialog = new GoToLineDialog("Go To Line", scope String()..AppendF("Line Number ({0}-{1})", 1, mEditWidget.Content.GetLineCount()));
aDialog.Init(this);
aDialog.PopupWindow(mWidgetWindow);
}
@ -5645,8 +5662,22 @@ namespace IDE.ui
if ((mHoverResolveTask == null) &&
((debugExpr == null) || (!debugExpr.StartsWith(':'))))
{
bool wantDebugEval = false;
if ((gApp.mDebugger.mIsRunning) && (!String.IsNullOrEmpty(debugExpr)))
{
wantDebugEval = true;
if (FilteredProjectSource != null)
{
// This is active Beef source
if ((debugExpr[0].IsNumber) || (debugExpr.StartsWith('\'')) || (debugExpr.StartsWith('"')))
{
// Literal, don't debug eval
wantDebugEval = false;
}
}
}
if (((!gApp.mDebugger.mIsRunning) || (!mHoverWatch.HasDisplay)) && // Don't show extended information for debug watches
if (((!wantDebugEval) || (!mHoverWatch.HasDisplay)) && // Don't show extended information for debug watches
(!handlingHoverResolveTask) && (ResolveCompiler != null) && (!ResolveCompiler.mThreadWorkerHi.mThreadRunning) && (gApp.mSettings.mEditorSettings.mHiliteCursorReferences) && (!gApp.mDeterministic))
{
ResolveParams resolveParams = new .();
@ -7335,7 +7366,13 @@ namespace IDE.ui
int collapseIndex = collapseVal & CollapseRegionView.cIdMask;
var entry = ewc.mOrderedCollapseEntries[collapseIndex];
ewc.SetCollapseOpen(collapseIndex, !entry.mIsOpen);
if ((mWidgetWindow.IsKeyDown(.Control)))
{
ewc.[Friend]SetCollapseLineOpen(lineClick, !entry.mIsOpen, true);
}
else
ewc.SetCollapseOpen(collapseIndex, !entry.mIsOpen);
}
return;
}
@ -7521,7 +7558,7 @@ namespace IDE.ui
SourceEditWidgetContent ewc = (.)mEditWidget.Content;
Rect linePointerRect = .(
mEditWidget.mX - GS!(20) - sDrawLeftAdjust,
0 + ewc.GetLineY(mLinePointerDrawData.mLine, 0),
0 + ewc.GetLineY(mLinePointerDrawData.mLine, 0) + ewc.GetTextOffset(),
GS!(15),
GS!(15)
);
@ -7538,7 +7575,7 @@ namespace IDE.ui
else if (mIsDraggingLinePointer)
{
SourceEditWidgetContent ewc = (.)mEditWidget.Content;
float linePos = ewc.GetLineY(GetLineAt(0, mMousePos.Value.y), 0);
float linePos = ewc.GetLineY(GetLineAt(0, mMousePos.Value.y), 0) + ewc.GetTextOffset();
Rect visibleRange = mEditWidget.GetVisibleContentRange();
if (visibleRange.Top > linePos)

View file

@ -1,3 +1,5 @@
#pragma warning disable 168
using System;
using System.IO;
using System.Collections;
@ -9,6 +11,7 @@ using IDE.util;
using Beefy.events;
using Beefy.theme;
using System.Diagnostics;
using Beefy.utils;
namespace IDE.ui
{
@ -17,6 +20,7 @@ namespace IDE.ui
class RecentWorkspacesScrollWidget : ScrollableWidget
{
public Font mTitleFont;
public bool mHasIcons;
public this()
{
@ -31,7 +35,7 @@ namespace IDE.ui
public override void Resize(float x, float y, float width, float height)
{
const float MARGIN = 3;
const float MARGIN = 0;
float currentY = 0;
float fillWidth = width - (mVertScrollbar?.Width).GetValueOrDefault();
@ -40,7 +44,7 @@ namespace IDE.ui
{
for (let widget in mScrollContent.mChildWidgets)
{
widget.Resize(0, currentY, fillWidth, GS!(30));
widget.Resize(0, currentY, fillWidth, GS!(33));
currentY += widget.Height + MARGIN;
}
}
@ -60,7 +64,7 @@ namespace IDE.ui
g.SetFont(mTitleFont);
using (g.PushColor(gApp.mSettings.mUISettings.mColors.mText))
g.DrawString("Recent Workspaces", 0, GS!(-30), .Centered, mWidth, .Ellipsis);
g.DrawString("Recent Workspaces", GS!(2), GS!(-30), .Centered, mWidth - GS!(4), .Ellipsis);
base.Draw(g);
}
@ -70,6 +74,8 @@ namespace IDE.ui
{
public static Font s_Font;
append String mPath;
public bool mTriedLoadIcon;
public Image mIcon ~ delete _;
public bool mPinned;
public RecentWorkspacesScrollWidget mRecentsParent;
@ -91,8 +97,67 @@ namespace IDE.ui
}
if (!mTriedLoadIcon)
{
mTriedLoadIcon = true;
StructuredData sd = scope .();
if (sd.Load(scope $"{mPath}/BeefProj.toml") case .Ok)
{
using (sd.Open("Platform"))
{
using (sd.Open("Windows"))
{
var iconFileName = sd.GetString("IconFile", .. scope .());
iconFileName.Replace("$(ProjectDir)", mPath);
iconFileName.Replace("$(WorkspaceDir)", mPath);
var iconFilePath = IO.Path.GetAbsolutePath(iconFileName, mPath, .. scope .());
if (File.Exists(iconFilePath))
{
int wantSize = 32;
if (var image = ResourceGen.LoadIcon(iconFilePath, wantSize))
{
if ((image.mWidth != wantSize) || (image.mHeight != wantSize))
{
image.Scale(wantSize / Math.Max(image.mWidth, image.mHeight));
}
mIcon = image;
mRecentsParent.mHasIcons = true;
}
}
}
}
}
}
g.SetFont(s_Font);
g.DrawString(mPath, 10, 0, .Left, mWidth - 10);
using (g.PushColor(gApp.mSettings.mUISettings.mColors.mText))
{
String drawStr = scope String();
int lastSlash = Math.Max(mPath.LastIndexOf('\\'), mPath.LastIndexOf('/'));
if (lastSlash != -1)
{
drawStr.Append(Font.EncodeColor(0x80FFFFFF));
drawStr.Append(mPath.Substring(0, lastSlash + 1));
drawStr.Append(Font.EncodePopColor());
drawStr.Append(mPath.Substring(lastSlash + 1));
}
else
{
drawStr.Append(mPath);
}
float drawX = GS!(50);
g.DrawString(drawStr, drawX, GS!(3), .Left, mWidth - drawX - GS!(2), .Ellipsis);
}
if (mIcon != null)
g.DrawCentered(mIcon, GS!(24), mHeight / 2);
else
{
using (g.PushColor(0x80FFFFFF))
g.DrawCentered(DarkTheme.sDarkTheme.GetImage(.Workspace), GS!(24), mHeight / 2);
}
}
public override void MouseEnter()

View file

@ -355,22 +355,22 @@ namespace IDE.ui
lineCount++;
}
String str = StackStringFormat!("Sel {0} | {1}", sel.MaxPos - sel.MinPos, lineCount);
String str = scope String()..AppendF("Sel {0} | {1}", sel.MaxPos - sel.MinPos, lineCount);
float curX = mWidth - GS!(240);
g.DrawString(str, curX, 0);
leftX = curX + g.mFont.GetWidth(str);
}
else if (showIndex)
g.DrawString(StackStringFormat!("Idx {0}", activeEditWidget.Content.CursorTextPos), mWidth - GS!(240), 0);
g.DrawString(scope String()..AppendF("Idx {0}", activeEditWidget.Content.CursorTextPos), mWidth - GS!(240), 0);
if (leftX >= mWidth - GS!(142))
{
g.DrawString(StackStringFormat!("Ln {0}:{1}", lineAndColumn.mLine + 1, lineAndColumn.mColumn + 1), mWidth - GS!(32), 0, .Right);
g.DrawString(scope String()..AppendF("Ln {0}:{1}", lineAndColumn.mLine + 1, lineAndColumn.mColumn + 1), mWidth - GS!(32), 0, .Right);
}
else
{
g.DrawString(StackStringFormat!("Ln {0}", lineAndColumn.mLine + 1), Math.Max(leftX + GS!(8), mWidth - GS!(150)), 0);
g.DrawString(StackStringFormat!("Col {0}", lineAndColumn.mColumn + 1), mWidth - GS!(78), 0);
g.DrawString(scope String()..AppendF("Ln {0}", lineAndColumn.mLine + 1), Math.Max(leftX + GS!(8), mWidth - GS!(150)), 0);
g.DrawString(scope String()..AppendF("Col {0}", lineAndColumn.mColumn + 1), mWidth - GS!(78), 0);
}
}
}
@ -532,7 +532,7 @@ namespace IDE.ui
if (gApp.mSettings.mEnableDevMode)
{
using (g.PushColor(DarkTheme.COLOR_TEXT))
g.DrawString(StackStringFormat!("FPS: {0}", gApp.mLastFPS), GS!(32), 0);
g.DrawString(scope String()..AppendF("FPS: {0}", gApp.mLastFPS), GS!(32), 0);
String resolveStr = scope String();
let bfResolveCompiler = gApp.mBfResolveCompiler;
@ -590,7 +590,35 @@ namespace IDE.ui
if (Rect(GS!(6), 0, GS!(20), mHeight).Contains(x, y))
{
gApp.mErrorsPanel.ShowErrorNext();
bool hasError = (gApp.mErrorsPanel.mErrorCount > 0);
bool hasWarning = (gApp.mErrorsPanel.mWarningCount > 0);
if (btn == 0)
{
gApp.mErrorsPanel.ShowErrorNext();
}
else if ((btn == 1) && ((hasError || hasWarning)))
{
float useX = x;
float useY = y;
Menu menu = new Menu();
var menuItem = menu.AddItem("Goto Next Error");
menuItem.mOnMenuItemSelected.Add(new (evt) =>
{
gApp.mErrorsPanel.ShowErrorNext();
});
menuItem = menu.AddItem("Clean Beef");
menuItem.mOnMenuItemSelected.Add(new (evt) =>
{
gApp.Cmd_CleanBeef();
});
MenuWidget menuWidget = DarkTheme.sDarkTheme.CreateMenuWidget(menu);
menuWidget.Init(this, useX, useY);
}
return;
}
}

View file

@ -50,7 +50,7 @@ namespace IDE.ui
if (!mTargetedProperties.mActiveConfigName.IsEmpty)
{
String dispStr = StackStringFormat!("Active({0})", mTargetedProperties.mActiveConfigName);
String dispStr = scope String()..AppendF("Active({0})", mTargetedProperties.mActiveConfigName);
item = menu.AddItem(dispStr);
item.mOnMenuItemSelected.Add(new (evt) => { SelectConfig(mTargetedProperties.mActiveConfigName); });
}
@ -549,7 +549,7 @@ namespace IDE.ui
if (!mActiveConfigName.IsEmpty)
{
String dispStr = StackStringFormat!("Active({0})", mActiveConfigName);
String dispStr = scope String()..AppendF("Active({0})", mActiveConfigName);
item = menu.AddItem(dispStr);
item.mOnMenuItemSelected.Add(new (evt) => { SelectConfig(mActiveConfigName); });
}
@ -613,7 +613,7 @@ namespace IDE.ui
{
if (!platformName.IsEmpty)
{
String dispStr = (IDEApp.sApp.mPlatformName == platformName) ? StackStringFormat!("Active({0})", platformName) : platformName;
String dispStr = (IDEApp.sApp.mPlatformName == platformName) ? scope String()..AppendF("Active({0})", platformName) : platformName;
item = menu.AddItem(dispStr);
item.mOnMenuItemSelected.Add(new (evt) => { SelectPlatform(platformName); });
}
@ -692,7 +692,7 @@ namespace IDE.ui
{
if (mConfigNames.Count == 1)
{
String dispStr = ((mConfigNames.Count == 1) && (mActiveConfigName == mConfigNames[0])) ? StackStringFormat!("Active({0})", mConfigNames[0]) : mConfigNames[0];
String dispStr = ((mConfigNames.Count == 1) && (mActiveConfigName == mConfigNames[0])) ? scope String()..AppendF("Active({0})", mConfigNames[0]) : mConfigNames[0];
mConfigComboBox.Label = dispStr;
}
else
@ -716,7 +716,7 @@ namespace IDE.ui
{
if (mPlatformNames.Count == 1)
{
String dispStr = ((mPlatformNames.Count == 1) && (mActivePlatformName == mPlatformNames[0])) ? StackStringFormat!("Active({0})", mPlatformNames[0]) : mPlatformNames[0];
String dispStr = ((mPlatformNames.Count == 1) && (mActivePlatformName == mPlatformNames[0])) ? scope String()..AppendF("Active({0})", mPlatformNames[0]) : mPlatformNames[0];
mPlatformComboBox.Label = dispStr;
}
else

View file

@ -54,6 +54,8 @@ namespace IDE.ui
public bool mIsNewExpression;
public bool mIsPending;
public bool mUsedLock;
public bool? mAutoRefresh;
public int32 mDebuggerStateIdx;
public int32 mCurStackIdx;
public int mMemoryBreakpointAddr;
public int32 mHadStepCount;
@ -66,6 +68,24 @@ namespace IDE.ui
public int32 mSeriesFirstVersion = -1;
public int32 mSeriesVersion = -1;
public bool AutoRefresh
{
get
{
if (mAutoRefresh != null)
return mAutoRefresh.Value;
return gApp.mSettings.mDebuggerSettings.mAutoRefreshWatches;
}
set
{
if (value == gApp.mSettings.mDebuggerSettings.mAutoRefreshWatches)
mAutoRefresh = null;
else
mAutoRefresh = value;
}
}
public bool IsConstant
{
get
@ -1644,8 +1664,8 @@ namespace IDE.ui
if (mShowStatusBar)
{
g.DrawString(textPosString, 16, textY, .Left, mWidth - GS!(140), .Ellipsis);
g.DrawString(StackStringFormat!("Ln {0}", line + 1), mWidth - GS!(130), textY);
g.DrawString(StackStringFormat!("Col {0}", col + 1), mWidth - GS!(70), textY);
g.DrawString(scope String()..AppendF("Ln {0}", line + 1), mWidth - GS!(130), textY);
g.DrawString(scope String()..AppendF("Col {0}", col + 1), mWidth - GS!(70), textY);
}
//using (g.PushColor(0xD0FFFFFF))
@ -1793,7 +1813,8 @@ namespace IDE.ui
public bool mFindMismatch;
public bool mChildHasMatch;
public String mColoredLabel ~ delete _;
bool mWantRemoveSelf;
public bool mWantRemoveSelf;
public bool mFreezeHeight;
public WatchRefreshButton mWatchRefreshButton;
public ActionButton mActionButton;
@ -1941,7 +1962,7 @@ namespace IDE.ui
if (tooltip != null)
{
tooltip.mRelWidgetMouseInsets = new Insets(0, 0, GS!(-8), 0);
tooltip.mAllowMouseInsideSelf = true;
tooltip.mAllowMouseInsideInsets = new .(GS!(-12), GS!(-12), GS!(-4), GS!(-4));
tooltip.AddWidget(watchStringEdit);
tooltip.mOnResized.Add(new (widget) => watchStringEdit.Resize(GS!(6), GS!(6), widget.mWidth - GS!(6) * 2, widget.mHeight - GS!(6) * 2));
tooltip.mOnResized(tooltip);
@ -1968,7 +1989,32 @@ namespace IDE.ui
{
mWatchRefreshButton = new WatchRefreshButton();
mWatchRefreshButton.Resize(GS!(-16), 0, GS!(20), GS!(20));
mWatchRefreshButton.mOnMouseDown.Add(new (evt) => RefreshWatch());
mWatchRefreshButton.mOnMouseDown.Add(new (evt) =>
{
if (evt.mBtn == 0)
RefreshWatch();
if (evt.mBtn == 1)
{
Menu menu = new Menu();
Menu anItem;
anItem = menu.AddItem("Refresh");
anItem.mOnMenuItemSelected.Add(new (item) => { RefreshWatch(); });
anItem = menu.AddItem("Auto Refresh");
if (mWatchEntry.AutoRefresh)
anItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Check);
anItem.mOnMenuItemSelected.Add(new (item) =>
{
mWatchEntry.AutoRefresh = !mWatchEntry.AutoRefresh;
if (mWatchEntry.AutoRefresh)
RefreshWatch();
});
MenuWidget menuWidget = ThemeFactory.mDefault.CreateMenuWidget(menu);
menuWidget.Init(mWatchRefreshButton, evt.mX, mHeight + GS!(2));
}
});
var typeSubItem = GetSubItem(columnIdx);
typeSubItem.AddWidget(mWatchRefreshButton);
mListView.mListSizeDirty = true;
@ -2024,7 +2070,7 @@ namespace IDE.ui
if ((mDisabled) && (allowRefresh))
{
AddRefreshButton();
AddRefreshButton();
}
else if (mWatchRefreshButton != null)
{
@ -2061,7 +2107,7 @@ namespace IDE.ui
return retVal;
}
void RefreshWatch()
public void RefreshWatch()
{
var parentWatchListViewItem = mParentItem as WatchListViewItem;
if (parentWatchListViewItem != null)
@ -2635,9 +2681,9 @@ namespace IDE.ui
}
var dispStr = scope String();
dispStr.AppendF(mWatchSeriesInfo.mDisplayTemplate, params formatParams);
dispStr.AppendF(mWatchSeriesInfo.mDisplayTemplate, params formatParams).IgnoreError();
var evalStr = scope String();
evalStr.AppendF(mWatchSeriesInfo.mEvalTemplate, params formatParams);
evalStr.AppendF(mWatchSeriesInfo.mEvalTemplate, params formatParams).IgnoreError();
watchListView.mWatchOwner.SetupListViewItem(curWatchListViewItem, dispStr, evalStr);
curWatchListViewItem.mWatchEntry.mSeriesFirstVersion = mWatchSeriesInfo.mSeriesFirstVersion;
@ -2860,7 +2906,10 @@ namespace IDE.ui
base.UpdateAll();
if (mWantRemoveSelf)
{
mParentItem?.RemoveChildItem(this);
return;
}
if (mColumnIdx == 0)
{
@ -2890,7 +2939,9 @@ namespace IDE.ui
wantHeight = 0;
else
wantHeight = watchListView.mFont.GetLineSpacing();
if (mSelfHeight != wantHeight)
var dataItem = GetSubItem(1) as WatchListViewItem;
if ((mSelfHeight != wantHeight) && (!mFreezeHeight) && (dataItem.mCustomContentWidget == null))
{
mSelfHeight = wantHeight;
watchListView.mListSizeDirty = true;
@ -2997,7 +3048,12 @@ namespace IDE.ui
for (WatchListViewItem watchListViewItem in childItems)
{
var watchEntry = watchListViewItem.mWatchEntry;
data.Add(watchEntry.mEvalStr);
using (data.CreateObject())
{
data.Add("EvalStr", watchEntry.mEvalStr);
if (watchEntry.mAutoRefresh != null)
data.Add("AutoRefresh", watchEntry.mAutoRefresh.Value);
}
}
}
}
@ -3017,14 +3073,23 @@ namespace IDE.ui
IDEUtils.DeserializeListViewState(data, mListView);
for (let itemKey in data.Enumerate("Items"))
{
//for (int32 watchIdx = 0; watchIdx < data.Count; watchIdx++)
//for (var watchKV in data)
{
String watchEntry = scope String();
//data.GetString(watchIdx, watchEntry);
data.GetCurString(watchEntry);
AddWatch(watchEntry);
}
String watchEntry = scope String();
data.GetCurString(watchEntry);
WatchListViewItem watchItem;
if (!watchEntry.IsEmpty)
{
watchItem = AddWatch(watchEntry);
}
else
{
data.GetString("EvalStr", watchEntry);
watchItem = AddWatch(watchEntry);
if (data.Contains("AutoRefresh"))
{
watchItem.mWatchEntry.mAutoRefresh = data.GetBool("AutoRefresh");
}
}
}
return true;
@ -3622,6 +3687,12 @@ namespace IDE.ui
}
else if (watch.mEvalStr.Length > 0)
{
if (!gApp.mDebugger.IsPaused())
{
// Keep waiting
return;
}
String evalStr = scope String(1024);
if (watch.mStackFrameId != null)
{
@ -3637,6 +3708,7 @@ namespace IDE.ui
DebugManager.EvalExpressionFlags flags = .AllowStringView;
if (watch.mIsNewExpression)
flags |= .AllowSideEffects | .AllowCalls;
gApp.DebugEvaluate(null, evalStr, val, -1, watch.mLanguage, flags);
watch.mIsNewExpression = false;
}
@ -3666,6 +3738,14 @@ namespace IDE.ui
if (((!valueSubItem.mFailed) && (watch.mHadValue)) || (hadSideEffects) || (hadPropertyEval))
{
watch.mHasValue = true;
if ((hadSideEffects) && (watch.AutoRefresh))
{
if (watch.mDebuggerStateIdx != gApp.mDebugger.mStateIdx)
listViewItem.RefreshWatch();
return;
}
listViewItem.SetDisabled(true, hadSideEffects);
return;
}
@ -3730,6 +3810,7 @@ namespace IDE.ui
watch.mIsStackAlloc = false;
watch.mUsedLock = false;
watch.mCurStackIdx = -1;
watch.mDebuggerStateIdx = gApp.mDebugger.mStateIdx;
watch.mLanguage = .NotSet;
DeleteAndNullify!(watch.mEditInitialize);
DeleteAndNullify!(watch.mAction);

View file

@ -596,7 +596,7 @@ namespace IDE.ui
curWorkspaceOptions.mConfigSelections.TryGetValue(project, out setConfigSelection);
if (setConfigSelection == null)
{
IDEApp.sApp.Fail(StackStringFormat!("Project '{0}' not in workspace", project.mProjectName));
IDEApp.sApp.Fail(scope String()..AppendF("Project '{0}' not in workspace", project.mProjectName));
return;
}
setConfigSelection.mEnabled = newConfigSelection.mEnabled;