Code folding in the script editor works again. Fixes #115.

This commit is contained in:
biwa 2019-12-24 15:58:20 +01:00
parent e187872553
commit 37c52b4d70
2 changed files with 3 additions and 3 deletions

View file

@ -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());
}

View file

@ -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");