diff options
author | Ken Moore <moorekou@gmail.com> | 2020-04-24 16:37:16 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2020-04-24 16:37:16 -0400 |
commit | 94c923507b0db790e5c48b79c2bf51e61e2057c4 (patch) | |
tree | 58398e38a77726273491368edbdb93d87a72a86e /src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp | |
parent | Fix up the detection of icons for windows. (diff) | |
download | lumina-94c923507b0db790e5c48b79c2bf51e61e2057c4.tar.gz lumina-94c923507b0db790e5c48b79c2bf51e61e2057c4.tar.bz2 lumina-94c923507b0db790e5c48b79c2bf51e61e2057c4.zip |
Update some syntax highlighting handling.
Prevent multi-line rules from starting within a section that was handled by a single-line rule earlier.
Also add a 1s delay/timer on file reload if it changes in the background.
Also add detection for bash scripts automatically
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp index 0aedb1a0..ed3ca2c3 100644 --- a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp +++ b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp @@ -34,13 +34,17 @@ PlainTextEditor::PlainTextEditor(QSettings *set, QWidget *parent) : QPlainTextEd //this->setObjectName("PlainTextEditor"); //this->setStyleSheet("QPlainTextEdit#PlainTextEditor{ }"); SYNTAX = new Custom_Syntax(settings, this->document()); + FTIMER = new QTimer(this); + FTIMER->setInterval(1000); + FTIMER->setSingleShot(true); connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(LNW_updateWidth()) ); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(LNW_highlightLine()) ); connect(this, SIGNAL(updateRequest(const QRect&, int)), this, SLOT(LNW_update(const QRect&, int)) ); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(checkMatchChar()) ); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(cursorMoved()) ); connect(this, SIGNAL(textChanged()), this, SLOT(textChanged()) ); - connect(watcher, SIGNAL(fileChanged(const QString&)), this, SLOT(fileChanged()) ); + connect(watcher, SIGNAL(fileChanged(const QString&)), FTIMER, SLOT(start()) ); + connect(FTIMER, SIGNAL(timeout()), this, SLOT(fileChanged())); LNW_updateWidth(); LNW_highlightLine(); } |