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

Fixed doing a Browse after a wrong AutoFind

This commit is contained in:
Brian Fiete 2020-04-20 06:59:39 -07:00
parent b0e5991934
commit 2165a6401e

View file

@ -2143,30 +2143,10 @@ namespace IDE.ui
mSplitTopPanel.DetachFromProjectItem(); mSplitTopPanel.DetachFromProjectItem();
} }
public override void Dispose() public void CloseEdit()
{ {
if (mDisposed)
return;
ProcessDeferredResolveResults(-1);
if (IDEApp.sApp.mLastActiveSourceViewPanel == this)
IDEApp.sApp.mLastActiveSourceViewPanel = null;
if (IDEApp.sApp.mLastActivePanel == this)
IDEApp.sApp.mLastActivePanel = null;
if (Content.Data.mCurQuickFind != null)
{
//Content.Data.mCurQuickFind.Close();
Content.Data.mCurQuickFind = null;
}
mEditWidget.mPanel = null; mEditWidget.mPanel = null;
if (mFilePath != null)
IDEApp.sApp.mFileWatcher.RemoveWatch(mFilePath);
var editWidgetContent = (SourceEditWidgetContent)mEditWidget.Content; var editWidgetContent = (SourceEditWidgetContent)mEditWidget.Content;
if (editWidgetContent.mAutoComplete != null) if (editWidgetContent.mAutoComplete != null)
editWidgetContent.mAutoComplete.Close(); editWidgetContent.mAutoComplete.Close();
@ -2208,6 +2188,32 @@ namespace IDE.ui
// This isn't needed anymore... // This isn't needed anymore...
gApp.DeleteEditData(mEditData); gApp.DeleteEditData(mEditData);
} }
mEditData = null;
}
public override void Dispose()
{
if (mDisposed)
return;
ProcessDeferredResolveResults(-1);
if (IDEApp.sApp.mLastActiveSourceViewPanel == this)
IDEApp.sApp.mLastActiveSourceViewPanel = null;
if (IDEApp.sApp.mLastActivePanel == this)
IDEApp.sApp.mLastActivePanel = null;
if (Content.Data.mCurQuickFind != null)
{
//Content.Data.mCurQuickFind.Close();
Content.Data.mCurQuickFind = null;
}
if (mFilePath != null)
IDEApp.sApp.mFileWatcher.RemoveWatch(mFilePath);
CloseEdit();
/*if (mProjectSource != null) /*if (mProjectSource != null)
mProjectSource.ClearUnsavedData();*/ mProjectSource.ClearUnsavedData();*/
@ -2928,9 +2934,7 @@ namespace IDE.ui
{ {
for (String filePath in fileDialog.FileNames) for (String filePath in fileDialog.FileNames)
{ {
delete mAliasFilePath; mFilePath.Set(filePath);
mAliasFilePath = mFilePath;
mFilePath = new String(filePath);
RehupAlias(); RehupAlias();
RetryLoad(); RetryLoad();
break; break;
@ -3254,9 +3258,19 @@ namespace IDE.ui
public void Reload() public void Reload()
{ {
bool needsFreshLoad = mLoadFailed;
if ((mEditData != null) && (!Path.Equals(mFilePath, mEditData.mFilePath)))
{
// This can happen if we do an Auto Find for source, which finds an incorrect file but then we Brose
// to the correct version
CloseEdit();
needsFreshLoad = true;
}
//TODO: Why did we ClearTrackedElements here? It caused reloads to not move breakpoints and stuff... //TODO: Why did we ClearTrackedElements here? It caused reloads to not move breakpoints and stuff...
//ClearTrackedElements(); //ClearTrackedElements();
if (mLoadFailed)
if (needsFreshLoad)
{ {
Show(mFilePath); Show(mFilePath);
ResizeComponents(); ResizeComponents();
@ -3321,6 +3335,8 @@ namespace IDE.ui
void RetryLoad() void RetryLoad()
{ {
CloseHeader();
Reload(); Reload();
if (mRequestedLineAndColumn != null) if (mRequestedLineAndColumn != null)
ShowFileLocation(-1, mRequestedLineAndColumn.Value.mLine, mRequestedLineAndColumn.Value.mColumn, .Always); ShowFileLocation(-1, mRequestedLineAndColumn.Value.mLine, mRequestedLineAndColumn.Value.mColumn, .Always);
@ -5820,9 +5836,7 @@ namespace IDE.ui
if (foundPath != null) if (foundPath != null)
{ {
delete mAliasFilePath; mFilePath.Set(foundPath);
mAliasFilePath = mFilePath;
mFilePath = new String(foundPath);
RehupAlias(); RehupAlias();
} }