aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2018-01-02 22:00:13 +0000
committerWeblate <noreply@weblate.org>2018-01-02 22:00:13 +0000
commit76f036e835d89572b92006c7f6d4918b7c799664 (patch)
treea80a82bda02e0fc740ea607767ad2409c8aeaa8d /src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
parentTranslated using Weblate (Portuguese (Brazil)) (diff)
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-76f036e835d89572b92006c7f6d4918b7c799664.tar.gz
lumina-76f036e835d89572b92006c7f6d4918b7c799664.tar.bz2
lumina-76f036e835d89572b92006c7f6d4918b7c799664.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
index bffbfd1a..9949a90c 100644
--- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
+++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
@@ -46,6 +46,7 @@ public:
void SetupDocument(QPlainTextEdit *editor);
bool supportsFile(QString file); //does this syntax set support the file?
+ bool supportsFirstLine(QString line); //is the type of file defined by the first line of the file? ("#!/bin/<something>" for instance)
//Main Loading routine (run this before other functions)
bool LoadFile(QString file, QSettings *settings);
@@ -66,10 +67,13 @@ public:
}
~Custom_Syntax(){}
+ QString loadedRules(){ return syntax.name(); }
+
static QStringList availableRules(QSettings *settings);
static QStringList knownColors();
static void SetupDefaultColors(QSettings *settings);
static QString ruleForFile(QString filename, QSettings *settings);
+ static QString ruleForFirstLine(QString line, QSettings *settings);
void loadRules(QString type);
void loadRules(SyntaxFile sfile);
@@ -77,6 +81,8 @@ public:
loadRules( syntax.name() );
}
+ void setupDocument(QPlainTextEdit *edit){ syntax.SetupDocument(edit); } //simple redirect for the function in the currently-loaded rules
+
protected:
void highlightBlock(const QString &text){
//qDebug() << "Highlight Block:" << text;
@@ -159,7 +165,7 @@ protected:
int last = text.length()-1;
while(last>=0 && (text[last]==' ' || text[last]=='\t' ) ){ last--; }
if(last < text.length()-1){
- setFormat(last+1, text.length()-1-last, fmt);
+ setFormat(last+1, text.length()-1-last, fmt);
}
}
}
bgstack15