ecode: Fix crash when loading big files and using the LSP. Try to detect binary files and don't display them with fallback fonts.

This commit is contained in:
Martín Lucas Golini
2023-03-13 19:24:58 -03:00
parent e59269c858
commit 1dea99ee82
5 changed files with 38 additions and 4 deletions

View File

@@ -85,7 +85,7 @@ class EE_API FontTrueType : public Font {
const Uint32& getFontInternalId() const;
bool getEnableFallbackFont() const;
bool isFallbackFontEnabled() const;
void setEnableFallbackFont( bool enableFallbackFont );

View File

@@ -555,6 +555,10 @@ class EE_API TextDocument {
String getWordInPosition();
bool mightBeBinary() const;
void setMightBeBinary( bool mightBeBinary );
protected:
friend class UndoStack;
@@ -581,6 +585,7 @@ class EE_API TextDocument {
bool mDirtyOnFileSystem{ false };
bool mSaving{ false };
bool mDeleteOnClose{ false };
bool mMightBeBinary{ false };
std::vector<std::pair<String::StringBaseType, String::StringBaseType>> mAutoCloseBracketsPairs;
Uint32 mIndentWidth{ 4 };
IndentType mIndentType{ IndentType::IndentTabs };