diff --git a/uppsrc/CodeEditor/Register.cpp b/uppsrc/CodeEditor/Register.cpp index 60c1d3998..bafac6e7d 100644 --- a/uppsrc/CodeEditor/Register.cpp +++ b/uppsrc/CodeEditor/Register.cpp @@ -37,4 +37,15 @@ String EditorSyntax::GetSyntaxForFilename(const char *fn) return Null; } +String EditorSyntax::GetSyntaxDescription(int i) +{ + String d = defs()[i].description; + String x = defs()[i].patterns; + if(x.GetCount()) { + x.Replace("*", ""); + d << " (" << TrimBoth(x) << ")"; + } + return d; +} + } diff --git a/uppsrc/CodeEditor/RegisterSyntax.cpp b/uppsrc/CodeEditor/RegisterSyntax.cpp index 33b6c0463..eb042392d 100644 --- a/uppsrc/CodeEditor/RegisterSyntax.cpp +++ b/uppsrc/CodeEditor/RegisterSyntax.cpp @@ -44,10 +44,10 @@ void RegisterSyntaxModules() RegisterCSyntax("json", CSyntax::HIGHLIGHT_JSON, "*.json", "JSON"); RegisterCSyntax("css", CSyntax::HIGHLIGHT_CSS, "*.css", "Cascading Style Sheet"); RegisterCSyntax("sql", CSyntax::HIGHLIGHT_SQL, "*.sql *.ddl", "SQL script"); - RegisterCSyntax("lay", CSyntax::HIGHLIGHT_LAY, "*.lay", "U++ layout (.lay)"); - RegisterCSyntax("sch", CSyntax::HIGHLIGHT_SCH, "*.sch", "U++ SQL schema (.sch)"); - RegisterCSyntax("t", CSyntax::HIGHLIGHT_T, "*.t *.jt", "U++ translation (.t)"); - RegisterCSyntax("usc", CSyntax::HIGHLIGHT_USC, "*.usc", "U++ widget definitions (.usc)"); + RegisterCSyntax("lay", CSyntax::HIGHLIGHT_LAY, "*.lay", "U++ layout"); + RegisterCSyntax("sch", CSyntax::HIGHLIGHT_SCH, "*.sch", "U++ SQL schema"); + RegisterCSyntax("t", CSyntax::HIGHLIGHT_T, "*.t *.jt", "U++ translation"); + RegisterCSyntax("usc", CSyntax::HIGHLIGHT_USC, "*.usc", "U++ widget definitions"); RegisterCSyntax("calc", CSyntax::HIGHLIGHT_CALC, "", ""); RegisterCSyntax("php", CSyntax::HIGHLIGHT_PHP, "*.php", "PHP"); @@ -55,11 +55,11 @@ void RegisterSyntaxModules() EditorSyntax::Register("python", callback(CreatePythonSyntax), "*.py, *.pyc, *.pyd, *.pyo, *.pyw, *.pyz", "Python"); - EditorSyntax::Register("xml", callback2(CreateTagSyntax, false, false), "*.xml *.xsd", "XML (.xml)"); - EditorSyntax::Register("html", callback2(CreateTagSyntax, true, false), "*.html *.htm", "HTML (.html)"); - EditorSyntax::Register("witz", callback2(CreateTagSyntax, true, true), "*.witz", "Skylark templates (.witz)"); + EditorSyntax::Register("xml", callback2(CreateTagSyntax, false, false), "*.xml *.xsd", "XML"); + EditorSyntax::Register("html", callback2(CreateTagSyntax, true, false), "*.html *.htm", "HTML"); + EditorSyntax::Register("witz", callback2(CreateTagSyntax, true, true), "*.witz", "Skylark templates"); - EditorSyntax::Register("log", callback(CreateLogSyntax), "*.log *.info", "Log (*.log)"); + EditorSyntax::Register("log", callback(CreateLogSyntax), "*.log *.info", "Log"); } } diff --git a/uppsrc/CodeEditor/Syntax.h b/uppsrc/CodeEditor/Syntax.h index 55579d24e..743ec1780 100644 --- a/uppsrc/CodeEditor/Syntax.h +++ b/uppsrc/CodeEditor/Syntax.h @@ -136,7 +136,7 @@ public: static String GetSyntaxForFilename(const char *fn); static int GetSyntaxCount() { return defs().GetCount(); } static String GetSyntax(int i) { return defs().GetKey(i); } - static String GetSyntaxDescription(int i) { return defs()[i].description; } + static String GetSyntaxDescription(int i); static String GetSyntaxPatterns(int i) { return defs()[i].patterns; } }; diff --git a/uppsrc/ide/idefile.cpp b/uppsrc/ide/idefile.cpp index 7b8db87c5..c5a9ab770 100644 --- a/uppsrc/ide/idefile.cpp +++ b/uppsrc/ide/idefile.cpp @@ -165,6 +165,7 @@ void Ide::FileProperties() if(desc.GetCount()) d.highlight.Add(EditorSyntax::GetSyntax(i), desc); } + d.highlight.Add("none", "None"); d.tabsize <<= f.tabsize > 0 ? f.tabsize : Null; d.tabsize <<= d.Breaker(111); d.tabsize.MinMax(1, 100);