mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Added a wait-for-classify on initial showing to reduce color flashing
This commit is contained in:
parent
287922693e
commit
ba2c4faa59
2 changed files with 21 additions and 4 deletions
|
@ -1148,11 +1148,16 @@ namespace IDE.ui
|
|||
compiler.DoBackgroundHi(new () => { DoClassify(.Autocomplete, resolveParams, true); }, new => ClassifyThreadDone);
|
||||
//BackgroundResolve(new () => { DoClassify(.Autocomplete, resolveParams); });
|
||||
else if (useResolveType == .ClassifyFullRefresh)
|
||||
{
|
||||
// To avoid "flashing" on proper colorization vs FastClassify, we wait a bit for the proper classifying to finish
|
||||
// on initial show
|
||||
int maxWait = (mUpdateCnt <= 1) ? 50 : 0;
|
||||
compiler.DoBackground(new () => { DoClassify(.ClassifyFullRefresh, resolveParams, false); },
|
||||
new () =>
|
||||
{
|
||||
ClassifyThreadDone();
|
||||
});
|
||||
}, maxWait);
|
||||
}
|
||||
else if (useResolveType == .GetCurrentLocation)
|
||||
compiler.DoBackgroundHi(new () => { DoClassify(.GetCurrentLocation, resolveParams, true); }, new => ClassifyThreadDone);
|
||||
else if (useResolveType == .GetSymbolInfo)
|
||||
|
@ -5425,6 +5430,8 @@ namespace IDE.ui
|
|||
|
||||
// Wait longer for Clang since it'll delay autocompletions whereas Beef can be interrupted
|
||||
int32 classifyDelayTicks = (mIsBeefSource || (mUpdateCnt < 40)) ? 2 : 40;
|
||||
if (mUpdateCnt <= 1)
|
||||
classifyDelayTicks = 0;
|
||||
|
||||
if (mWantsBackgroundAutocomplete)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue