aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp4
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h8
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntax_rules/xml.syntax75
3 files changed, 75 insertions, 12 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
index e5286e7b..646c2e98 100644
--- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
@@ -175,10 +175,6 @@ QStringList Custom_Syntax::availableRules(QSettings *settings){
QStringList avail;
QList<SyntaxFile> files = SyntaxFile::availableFiles(settings);
for(int i=0; i<files.length(); i++){ avail << files[i].name(); }
- /*avail << "C++";
- //avail << "Python";
- avail << "Shell";
- avail << "reST";*/
return avail;
}
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
index d168b70f..bffbfd1a 100644
--- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
+++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
@@ -24,11 +24,6 @@ struct SyntaxRule{
QRegExp startPattern, endPattern; //multi-line rules
QTextCharFormat format;
};
-//Complicated/multi-line rules
-struct SyntaxRuleSplit{
- QRegExp startPattern, endPattern;
- QTextCharFormat format;
-};
class SyntaxFile{
private:
@@ -63,10 +58,7 @@ class Custom_Syntax : public QSyntaxHighlighter{
Q_OBJECT
private:
QSettings *settings;
- //QString lasttype;
SyntaxFile syntax;
- //QVector<SyntaxRule> rules;
- //QVector<SyntaxRuleSplit> splitrules;
public:
Custom_Syntax(QSettings *set, QTextDocument *parent = 0) : QSyntaxHighlighter(parent){
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/xml.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/xml.syntax
new file mode 100644
index 00000000..3ceb22fa
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/xml.syntax
@@ -0,0 +1,75 @@
+# Syntax support file for the Lumina Text Editor
+# ===================================
+# XML language support rules
+# Written by Ken Moore <ken@ixsystems.com>
+# Released under the 2-clause BSD license
+# ===================================
+
+{
+ "meta": {
+ "name": "XML",
+ "file_suffix": ["xml", "xslt", "jsx", "jrs"]
+ },
+ "format": {
+ "line_wrap": false,
+ "highlight_whitespace_eol" : true,
+ "columns_per_line" : 70,
+ "font_type" : "monospace",
+ "tab_width": 8
+ },
+ "rules": [{
+ "name": "8 spaces rather than a tab",
+ "regex": "([ ]{8})+",
+ "background": "colors/bracket-missing"
+ },
+ {
+ "name": "tabs after spaces",
+ "regex": "( )+\\t",
+ "background": "colors/bracket-missing"
+ },
+ {
+ "name" : "odd number of spaces within indentation",
+ "regex": "(^|\\t)([ ]{2})*[ ](?=\\<)",
+ "background": "colors/bracket-missing"
+ },
+ {
+ "name" : "ID of a tag",
+ "regex": "<[^> ]+[>]?",
+ "font_weight" : "bold",
+ "foreground" : "colors/function"
+ },
+ {
+ "name" : "tag modifiers",
+ "regex" : "\\s[^\\= ]+(?=\\=)",
+ "foreground" : "colors/class"
+ },
+ {
+ "name" : "strings inside a tag",
+ "regex": "\\\"[^\\\"]*\\\"",
+ "foreground" : "colors/text"
+ },
+ {
+ "name" : "comment",
+ "regex_start" : "<!DOCTYPE",
+ "regex_end" : "[/]?>",
+ "foreground" : "colors/comment"
+ },
+ {
+ "name" : "comment",
+ "regex_start" : "<!--",
+ "regex_end" : "-->",
+ "foreground" : "colors/comment"
+ },
+ {
+ "name" : "escapes",
+ "regex" : "&[^;]*;",
+ "foreground" : "colors/preprocessor"
+ },
+ {
+ "name" : "XML preprocessor",
+ "regex_start" : "\\<\\?xml ",
+ "regex_end" : "\\?>",
+ "foreground" : "colors/preprocessor"
+ }
+ ]
+}
bgstack15