mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 00:20:25 +02:00
Fixes for ShowWrongHash, looking into debug info issues in opt llvm
This commit is contained in:
parent
c67fbd66ba
commit
54d5884213
8 changed files with 69 additions and 34 deletions
|
@ -2022,7 +2022,7 @@ namespace IDE.ui
|
|||
|
||||
if (!mClosed)
|
||||
{
|
||||
if ((DarkTooltipManager.sTooltip != null) && (!DarkTooltipManager.sTooltip.mRequireMouseInside))
|
||||
if ((DarkTooltipManager.sTooltip != null) && (DarkTooltipManager.sTooltip.mAllowMouseOutside))
|
||||
DarkTooltipManager.CloseTooltip();
|
||||
|
||||
if (IsInPanel())
|
||||
|
|
|
@ -2729,7 +2729,7 @@ namespace IDE.ui
|
|||
{
|
||||
if (mWidgetWindow.IsKeyDown(.Control))
|
||||
{
|
||||
if ((DarkTooltipManager.sTooltip != null) && (!DarkTooltipManager.sTooltip.mRequireMouseInside))
|
||||
if ((DarkTooltipManager.sTooltip != null) && (DarkTooltipManager.sTooltip.mAllowMouseOutside))
|
||||
DarkTooltipManager.CloseTooltip();
|
||||
gApp.mSettings.mTutorialsFinished.mCtrlCursor = true;
|
||||
}
|
||||
|
@ -2739,7 +2739,7 @@ namespace IDE.ui
|
|||
|
||||
let tooltip = DarkTooltipManager.ShowTooltip("Hold CTRL when using UP and DOWN", this, cursorX - GS!(24), cursorY - GS!(40));
|
||||
if (tooltip != null)
|
||||
tooltip.mRequireMouseInside = false;
|
||||
tooltip.mAllowMouseOutside = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -303,6 +303,8 @@ namespace IDE.ui
|
|||
{
|
||||
switch (lhs)
|
||||
{
|
||||
case .None:
|
||||
return rhs case .None;
|
||||
case .MD5(let lhsMD5):
|
||||
if (rhs case .MD5(let rhsMD5))
|
||||
return lhsMD5 == rhsMD5;
|
||||
|
@ -3106,7 +3108,7 @@ namespace IDE.ui
|
|||
ResizeComponents();
|
||||
}
|
||||
|
||||
void ShowWrongHash()
|
||||
public void ShowWrongHash()
|
||||
{
|
||||
CloseHeader();
|
||||
|
||||
|
@ -3335,6 +3337,38 @@ namespace IDE.ui
|
|||
CheckBinary();
|
||||
}
|
||||
|
||||
void CheckAdjustFile()
|
||||
{
|
||||
if (mLoadedHash == .None)
|
||||
return;
|
||||
|
||||
String text = scope .();
|
||||
if (File.ReadAllText(mFilePath, text, true) case .Err)
|
||||
return;
|
||||
|
||||
SourceHash textHash = SourceHash.Create(mLoadedHash.GetKind(), text);
|
||||
if (textHash == mLoadedHash)
|
||||
return;
|
||||
|
||||
if (text.Contains('\r'))
|
||||
{
|
||||
text.Replace("\r", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
text.Replace("\n", "\r\n");
|
||||
}
|
||||
textHash = SourceHash.Create(mLoadedHash.GetKind(), text);
|
||||
if (textHash == mLoadedHash)
|
||||
{
|
||||
if (File.WriteAllText(mFilePath, text) case .Err)
|
||||
{
|
||||
gApp.mFileWatcher.OmitFileChange(mFilePath, text);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RetryLoad()
|
||||
{
|
||||
var prevHash = mLoadedHash;
|
||||
|
@ -5386,6 +5420,7 @@ namespace IDE.ui
|
|||
{
|
||||
if ((int)mOldVerLoadExecutionInstance.mExitCode == 0)
|
||||
{
|
||||
CheckAdjustFile();
|
||||
RetryLoad();
|
||||
}
|
||||
else
|
||||
|
@ -5403,6 +5438,7 @@ namespace IDE.ui
|
|||
if (result == .Failed)
|
||||
gApp.OutputErrorLine("Failed to retrieve source from {}", mOldVerLoadCmd);
|
||||
|
||||
CheckAdjustFile();
|
||||
RetryLoad();
|
||||
DeleteAndNullify!(mOldVerHTTPRequest);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue