summaryrefslogtreecommitdiffstats
path: root/kate/part/katehighlight.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2015-07-04 15:26:03 +0900
committerMichele Calgaro <[email protected]>2015-07-04 15:29:10 +0900
commit1d878f2ad1f8cff45520814d15fffccdab58ae1e (patch)
tree8ca2e25a72f7275068e1a5c49f5bfdbd3e0fbb39 /kate/part/katehighlight.cpp
parenta3e422826db8d3ec66119b63b3bda029b372baa9 (diff)
downloadtdelibs-1d878f2ad1f8cff45520814d15fffccdab58ae1e.tar.gz
tdelibs-1d878f2ad1f8cff45520814d15fffccdab58ae1e.zip
Fixed C++ support in Kate syntax highlighting code. This resolves bug 2455.
Signed-off-by: Michele Calgaro <[email protected]> (cherry picked from commit 4e55a1cfaa00035481a72f1271aee8954e3053ad)
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;