mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-18 08:06:04 +02:00
Fixed doing a Browse after a wrong AutoFind
This commit is contained in:
parent
b0e5991934
commit
2165a6401e
1 changed files with 49 additions and 35 deletions
|
@ -2143,38 +2143,18 @@ namespace IDE.ui
|
||||||
mSplitTopPanel.DetachFromProjectItem();
|
mSplitTopPanel.DetachFromProjectItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public void CloseEdit()
|
||||||
{
|
{
|
||||||
if (mDisposed)
|
mEditWidget.mPanel = null;
|
||||||
return;
|
|
||||||
|
|
||||||
ProcessDeferredResolveResults(-1);
|
var editWidgetContent = (SourceEditWidgetContent)mEditWidget.Content;
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
if (mFilePath != null)
|
|
||||||
IDEApp.sApp.mFileWatcher.RemoveWatch(mFilePath);
|
|
||||||
|
|
||||||
var editWidgetContent = (SourceEditWidgetContent)mEditWidget.Content;
|
|
||||||
if (editWidgetContent.mAutoComplete != null)
|
if (editWidgetContent.mAutoComplete != null)
|
||||||
editWidgetContent.mAutoComplete.Close();
|
editWidgetContent.mAutoComplete.Close();
|
||||||
DeleteAndNullify!(editWidgetContent.mOnGenerateAutocomplete);
|
DeleteAndNullify!(editWidgetContent.mOnGenerateAutocomplete);
|
||||||
DeleteAndNullify!(editWidgetContent.mOnEscape);
|
DeleteAndNullify!(editWidgetContent.mOnEscape);
|
||||||
DeleteAndNullify!(editWidgetContent.mOnFinishAsyncAutocomplete);
|
DeleteAndNullify!(editWidgetContent.mOnFinishAsyncAutocomplete);
|
||||||
DeleteAndNullify!(editWidgetContent.mOnCancelAsyncAutocomplete);
|
DeleteAndNullify!(editWidgetContent.mOnCancelAsyncAutocomplete);
|
||||||
editWidgetContent.mSourceViewPanel = null;
|
editWidgetContent.mSourceViewPanel = null;
|
||||||
mEditWidget.RemoveSelf();
|
mEditWidget.RemoveSelf();
|
||||||
|
|
||||||
if ((mEditData != null) && (mEditData.mEditWidget == mEditWidget))
|
if ((mEditData != null) && (mEditData.mEditWidget == mEditWidget))
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue