diff --git a/Source/Core/Controls/Scripting/ScriptDocumentTab.cs b/Source/Core/Controls/Scripting/ScriptDocumentTab.cs index f86ed449..e20a3771 100755 --- a/Source/Core/Controls/Scripting/ScriptDocumentTab.cs +++ b/Source/Core/Controls/Scripting/ScriptDocumentTab.cs @@ -381,7 +381,7 @@ namespace CodeImp.DoomBuilder.Controls // Text must be exactly the same long hash = MurmurHash2.Hash(Text); - bool applyfolding = General.Settings.ScriptShowFolding && (editor.Scintilla.Lexer == Lexer.Cpp /*|| editor.Scintilla.Lexer == Lexer.CppNoCase*/); + bool applyfolding = General.Settings.ScriptShowFolding && (editor.Scintilla.Lexer == Lexer.Cpp || (int)editor.Scintilla.Lexer == 35); // 35 - custom CPP case insensitive style lexer if(hash == settings.Hash) { // Restore fold levels @@ -402,7 +402,7 @@ namespace CodeImp.DoomBuilder.Controls internal void SetDefaultViewSettings() { - if(General.Settings.ScriptShowFolding && (editor.Scintilla.Lexer == Lexer.Cpp /*|| editor.Scintilla.Lexer == Lexer.CppNoCase*/)) + if(General.Settings.ScriptShowFolding && (editor.Scintilla.Lexer == Lexer.Cpp || (int)editor.Scintilla.Lexer == 35)) // 35 - custom CPP case insensitive style lexer ApplyFolding(GetFoldLevels()); } diff --git a/Source/Core/Controls/Scripting/ScriptEditorControl.cs b/Source/Core/Controls/Scripting/ScriptEditorControl.cs index e5556df5..849e28ab 100755 --- a/Source/Core/Controls/Scripting/ScriptEditorControl.cs +++ b/Source/Core/Controls/Scripting/ScriptEditorControl.cs @@ -479,7 +479,7 @@ namespace CodeImp.DoomBuilder.Controls handler.SetKeywords(lexercfg, lexername); // Setup folding (https://github.com/jacobslusser/ScintillaNET/wiki/Automatic-Code-Folding) - if(General.Settings.ScriptShowFolding && (scriptconfig.Lexer == Lexer.Cpp /*|| scriptconfig.Lexer == Lexer.CppNoCase*/)) + if(General.Settings.ScriptShowFolding && (scriptconfig.Lexer == Lexer.Cpp || (int)scriptconfig.Lexer == 35)) // 35 - custom CPP case insensitive style lexer { // Instruct the lexer to calculate folding scriptedit.SetProperty("fold", "1");