Branch: refs/heads/master Author: Matthew Brush matt@geany.org Committer: Matthew Brush matt@geany.org Date: Wed, 17 Sep 2014 23:49:58 UTC Commit: 634a4b111fd14eec9045653bb328c018285aa6ec https://github.com/geany/geany/commit/634a4b111fd14eec9045653bb328c018285aa6...
Log Message: ----------- Highlight C types from tags in C++ code
Useful for when using, for example, GTK+, SDL, and other C-only APIs in files with the C++ filetype. Before only the symbol auto-completion worked, but not the highlighting of type names.
TODO: figure out why taking something like SDL.c.tags and making a copy as SDL.cpp.tags doesn't work, once that's fixed, this extra condition could probably be removed.
Modified Paths: -------------- src/symbols.c
Modified: src/symbols.c 4 lines changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -50,6 +50,7 @@ #include "sciwrappers.h" #include "sidebar.h" #include "support.h" +#include "tm_parser.h" #include "tm_tag.h" #include "ui_utils.h" #include "utils.h" @@ -272,7 +273,8 @@ GString *symbols_find_tags_as_string(GPtrArray *tags_array, guint tag_types, gin /* the check for tag_lang == lang is necessary to avoid wrong type colouring of * e.g. PHP classes in C++ files * lang = -2 disables the check */ - if (tag->name && (tag_lang == lang || lang == -2)) + if (tag->name && (tag_lang == lang || lang == -2 || + (lang == TM_PARSER_CPP && tag_lang == TM_PARSER_C))) { if (j != 0) g_string_append_c(s, ' ');
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).