summaryrefslogtreecommitdiffstats
path: root/kate/part
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2015-07-04 15:26:03 +0900
committerSlávek Banko <slavek.banko@axis.cz>2015-12-23 02:23:03 +0100
commit8dd6378131e1dc762ce00902e370a49beb06fd8e (patch)
treeb376ac14d20cb5fd6ecb7d31fcd6962d7e805d03 /kate/part
parent4b089bde6eb5dae5657d17aa10a5a1964f24f0cd (diff)
downloadtdelibs-8dd6378131e1dc762ce00902e370a49beb06fd8e.tar.gz
tdelibs-8dd6378131e1dc762ce00902e370a49beb06fd8e.zip
Fixed C++ support in Kate syntax highlighting code. This resolves bug 2455.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 4e55a1cfaa00035481a72f1271aee8954e3053ad)
Diffstat (limited to 'kate/part')
-rw-r--r--kate/part/katehighlight.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/kate/part/katehighlight.cpp b/kate/part/katehighlight.cpp
index 49972cce1..82bbdee87 100644
--- a/kate/part/katehighlight.cpp
+++ b/kate/part/katehighlight.cpp
@@ -2438,28 +2438,33 @@ void KateHighlighting::makeContextList()
buildPrefix=it.key()+':'; // attribute names get prefixed by the names
// of the highlighting definitions they belong to
- if (identifierToUse.isEmpty() )
+ if (identifierToUse.isEmpty())
+ {
kdDebug(13010)<<"OHOH, unknown highlighting description referenced"<<endl;
-
- kdDebug(13010)<<"setting ("<<it.key()<<") to loaded"<<endl;
-
- //mark hl as loaded
- it=embeddedHls.insert(it.key(),KateEmbeddedHlInfo(true,startctx));
- //set class member for context 0 offset, so we don't need to pass it around
- buildContext0Offset=startctx;
- //parse one hl definition file
- startctx=addToContextList(identifierToUse,startctx);
-
- if (noHl) return; // an error occurred
-
- base_startctx = startctx;
- something_changed=true; // something has been loaded
+ kdDebug(13010)<<"Highlighting for ("<<it.key()<<") can not be loaded"<<endl;
+ }
+ else
+ {
+ // Only do this if we have a non-empty identifier
+ kdDebug(13010)<<"setting ("<<it.key()<<") to loaded"<<endl;
+
+ //mark hl as loaded
+ it=embeddedHls.insert(it.key(),KateEmbeddedHlInfo(true,startctx));
+ //set class member for context 0 offset, so we don't need to pass it around
+ buildContext0Offset=startctx;
+ //parse one hl definition file
+ startctx=addToContextList(identifierToUse,startctx);
+
+ if (noHl) return; // an error occurred
+
+ base_startctx = startctx;
+ something_changed=true; // something has been loaded
+ }
}
}
} while (something_changed); // as long as there has been another file parsed
// repeat everything, there could be newly added embedded hls.
-
// at this point all needed highlighing (sub)definitions are loaded. It's time
// to resolve cross file references (if there are any)
kdDebug(13010)<<"Unresolved contexts, which need attention: "<<unresolvedContextReferences.count()<<endl;