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:
parent
a9d9776bcb
commit
330eb037e8
4 changed files with 41 additions and 9 deletions
|
@ -74,6 +74,11 @@ namespace IDE
|
||||||
return mLastFileTextVersion != mEditWidget.Content.mData.mCurTextVersionId;
|
return mLastFileTextVersion != mEditWidget.Content.mData.mCurTextVersionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool HasEditPanel()
|
||||||
|
{
|
||||||
|
return mEditWidget.mPanel != null;
|
||||||
|
}
|
||||||
|
|
||||||
public bool Reload()
|
public bool Reload()
|
||||||
{
|
{
|
||||||
mHadRefusedFileChange = false;
|
mHadRefusedFileChange = false;
|
||||||
|
|
|
@ -12762,6 +12762,9 @@ namespace IDE
|
||||||
mLastFileChangeId = mFileWatcher.mChangeId;
|
mLastFileChangeId = mFileWatcher.mChangeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mSymbolReferenceHelper?.mKind == .Rename)
|
||||||
|
return;
|
||||||
|
|
||||||
var app = gApp;
|
var app = gApp;
|
||||||
Debug.Assert(app != null);
|
Debug.Assert(app != null);
|
||||||
|
|
||||||
|
@ -13138,6 +13141,9 @@ namespace IDE
|
||||||
|
|
||||||
void VerifyModifiedBuffers()
|
void VerifyModifiedBuffers()
|
||||||
{
|
{
|
||||||
|
if (mSymbolReferenceHelper?.mKind == .Rename)
|
||||||
|
return;
|
||||||
|
|
||||||
mWorkspace.WithProjectItems(scope (projectItem) =>
|
mWorkspace.WithProjectItems(scope (projectItem) =>
|
||||||
{
|
{
|
||||||
var projectSource = projectItem as ProjectSource;
|
var projectSource = projectItem as ProjectSource;
|
||||||
|
|
|
@ -720,6 +720,8 @@ namespace IDE.ui
|
||||||
|
|
||||||
void Dispose()
|
void Dispose()
|
||||||
{
|
{
|
||||||
|
bool hadChange = (mKind == Kind.Rename) && (mNewReplaceStr != mOrigReplaceStr);
|
||||||
|
|
||||||
mSourceViewPanel.CancelResolve(.GetSymbolInfo);
|
mSourceViewPanel.CancelResolve(.GetSymbolInfo);
|
||||||
if (mPassInstance != null)
|
if (mPassInstance != null)
|
||||||
{
|
{
|
||||||
|
@ -756,16 +758,25 @@ namespace IDE.ui
|
||||||
editWidgetContent.mData.mText[i].mDisplayFlags &= 0xFF ^ (uint8)(SourceElementFlags.SymbolReference);
|
editWidgetContent.mData.mText[i].mDisplayFlags &= 0xFF ^ (uint8)(SourceElementFlags.SymbolReference);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hadChange)
|
||||||
|
{
|
||||||
using (gApp.mMonitor.Enter())
|
using (gApp.mMonitor.Enter())
|
||||||
editData.SetSavedData(null, IdSpan());
|
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)
|
for (var projectSource in editData.mProjectSources)
|
||||||
app.mBfResolveCompiler.QueueProjectSource(projectSource, .None, false);
|
gApp.mBfResolveCompiler.QueueProjectSource(projectSource, .None, false);
|
||||||
app.mBfResolveCompiler.QueueDeferredResolveAll();
|
gApp.mBfResolveCompiler.QueueDeferredResolveAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,11 @@ namespace IDE.Util
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!editData.HasEditPanel())
|
||||||
|
{
|
||||||
|
gApp.SaveFile(editData);
|
||||||
|
}
|
||||||
|
|
||||||
if (IDEApp.IsBeefFile(editData.mFilePath))
|
if (IDEApp.IsBeefFile(editData.mFilePath))
|
||||||
{
|
{
|
||||||
for (var projectSource in editData.mProjectSources)
|
for (var projectSource in editData.mProjectSources)
|
||||||
|
@ -122,6 +127,11 @@ namespace IDE.Util
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!editData.HasEditPanel())
|
||||||
|
{
|
||||||
|
gApp.SaveFile(editData);
|
||||||
|
}
|
||||||
|
|
||||||
if (IDEApp.IsBeefFile(editData.mFilePath))
|
if (IDEApp.IsBeefFile(editData.mFilePath))
|
||||||
{
|
{
|
||||||
for (var projectSource in editData.mProjectSources)
|
for (var projectSource in editData.mProjectSources)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue