1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed save buffers during symbol rename

This commit is contained in:
Brian Fiete 2020-11-08 07:45:37 -08:00
parent a9d9776bcb
commit 330eb037e8
4 changed files with 41 additions and 9 deletions

View file

@ -74,6 +74,11 @@ namespace IDE
return mLastFileTextVersion != mEditWidget.Content.mData.mCurTextVersionId;
}
public bool HasEditPanel()
{
return mEditWidget.mPanel != null;
}
public bool Reload()
{
mHadRefusedFileChange = false;

View file

@ -12762,6 +12762,9 @@ namespace IDE
mLastFileChangeId = mFileWatcher.mChangeId;
}
if (mSymbolReferenceHelper?.mKind == .Rename)
return;
var app = gApp;
Debug.Assert(app != null);
@ -13138,6 +13141,9 @@ namespace IDE
void VerifyModifiedBuffers()
{
if (mSymbolReferenceHelper?.mKind == .Rename)
return;
mWorkspace.WithProjectItems(scope (projectItem) =>
{
var projectSource = projectItem as ProjectSource;

View file

@ -720,6 +720,8 @@ namespace IDE.ui
void Dispose()
{
bool hadChange = (mKind == Kind.Rename) && (mNewReplaceStr != mOrigReplaceStr);
mSourceViewPanel.CancelResolve(.GetSymbolInfo);
if (mPassInstance != null)
{
@ -756,16 +758,25 @@ namespace IDE.ui
editWidgetContent.mData.mText[i].mDisplayFlags &= 0xFF ^ (uint8)(SourceElementFlags.SymbolReference);
}
if (hadChange)
{
using (gApp.mMonitor.Enter())
editData.SetSavedData(null, IdSpan());
var app = IDEApp.sApp;
if ((mKind == Kind.Rename) && (IDEApp.IsBeefFile(editData.mFilePath)))
if (!editData.HasEditPanel())
{
gApp.SaveFile(editData);
}
if (IDEApp.IsBeefFile(editData.mFilePath))
{
for (var projectSource in editData.mProjectSources)
app.mBfResolveCompiler.QueueProjectSource(projectSource, .None, false);
app.mBfResolveCompiler.QueueDeferredResolveAll();
gApp.mBfResolveCompiler.QueueProjectSource(projectSource, .None, false);
gApp.mBfResolveCompiler.QueueDeferredResolveAll();
}
}
}
}
}
}

View file

@ -78,6 +78,11 @@ namespace IDE.Util
break;
}
if (!editData.HasEditPanel())
{
gApp.SaveFile(editData);
}
if (IDEApp.IsBeefFile(editData.mFilePath))
{
for (var projectSource in editData.mProjectSources)
@ -122,6 +127,11 @@ namespace IDE.Util
break;
}
if (!editData.HasEditPanel())
{
gApp.SaveFile(editData);
}
if (IDEApp.IsBeefFile(editData.mFilePath))
{
for (var projectSource in editData.mProjectSources)