summaryrefslogtreecommitdiffstats
path: root/kate/part/katehighlight.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2015-07-04 15:26:03 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2015-07-04 15:26:03 +0900
commit4e55a1cfaa00035481a72f1271aee8954e3053ad (patch)
tree8e292a5dc5661d692348b12218d5f9c1da953a9c /kate/part/katehighlight.cpp
parentce9d4765cc846d40b3156ccb6a457adca8097564 (diff)
downloadtdelibs-4e55a1cfaa00035481a72f1271aee8954e3053ad.tar.gz
tdelibs-4e55a1cfaa00035481a72f1271aee8954e3053ad.zip
Fixed C++ support in Kate syntax highlighting code. This resolves bug 2455.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kate/part/katehighlight.cpp')
-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 8c6ce36e5..1adbba2d5 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;