Browse Source

Added dark blue for methods and functions, also more definitions in the juci-style for other languages.

merge-requests/365/head
eidheim 10 years ago
parent
commit
1b757a2220
  1. 27
      src/files.h
  2. 8
      src/source.cc

27
src/files.h

@ -9,11 +9,12 @@ const std::string configjson =
" \"style\": \"juci\", //Use \"\" for default style. Styles from normal gtksourceview install: classic, cobalt, kate, oblivion, solarized-dark, solarized-light, tango\n"
" \"font\": \"Monospace\", //Use \"\" for default font, and for instance \"Monospace 12\" to also set size.\n"
" \"clang_types\": {\n"
" \"8\": \"def:function\",\n"
" \"21\": \"def:function\",\n"
" \"43\": \"def:type\",\n"
" \"45\": \"def:type\",\n"
" \"46\": \"def:identifier\",\n"
" \"102\": \"def:function\",\n"
" \"109\": \"def:constant\",\n"
" \"109\": \"def:string\",\n"
" \"500\": \"def:preprocessor\",\n"
" \"702\": \"def:statement\",\n"
" \"705\": \"def:comment\"\n"
@ -135,11 +136,12 @@ const std::string juci_style =
" <color name=\"red\" value=\"#CC0000\"/>\n"
" <color name=\"green\" value=\"#008800\"/>\n"
" <color name=\"blue\" value=\"#0000FF\"/>\n"
" <color name=\"dark-blue\" value=\"#000099\"/>\n"
" <color name=\"yellow\" value=\"#FFFF00\"/>\n"
" <color name=\"orange\" value=\"#FF8800\"/>\n"
" <color name=\"purple\" value=\"#990099\"/>\n"
"\n"
" <!-- Global Settings -->\n"
" <!-- Current Line Highlighting -->\n"
" <style name=\"current-line\" background=\"#eeeeec\"/>\n"
" <style name=\"current-line-number\" background=\"#eeeeec\"/>\n"
"\n"
@ -150,16 +152,25 @@ const std::string juci_style =
" <!-- Search Matching -->\n"
" <style name=\"search-match\" background=\"yellow\"/>\n"
"\n"
" <!-- Programming Language -->\n"
" <!-- Language specifics -->\n"
" <style name=\"def:builtin\" foreground=\"blue\"/>\n"
" <style name=\"def:constant\" foreground=\"blue\"/>\n"
" <style name=\"def:boolean\" foreground=\"red\"/>\n"
" <style name=\"def:decimal\" foreground=\"red\"/>\n"
" <style name=\"def:base-n-integer\" foreground=\"red\"/>\n"
" <style name=\"def:floating-point\" foreground=\"red\"/>\n"
" <style name=\"def:complex\" foreground=\"red\"/>\n"
" <style name=\"def:character\" foreground=\"red\"/>\n"
" <style name=\"def:special-char\" foreground=\"red\"/>\n"
"\n\n"
" <!-- Language specifics used by clang-parser in default config -->\n"
" <style name=\"def:string\" foreground=\"red\"/>\n"
" <style name=\"def:comment\" foreground=\"gray\"/>\n"
" <style name=\"def:constant\" foreground=\"red\"/>\n"
" <style name=\"def:statement\" foreground=\"blue\"/>\n"
" <style name=\"def:type\" foreground=\"blue\"/>\n"
" <style name=\"def:function\" foreground=\"blue\"/>\n"
" <style name=\"def:function\" foreground=\"dark-blue\"/>\n"
" <style name=\"def:identifier\" foreground=\"purple\"/>\n"
" <style name=\"def:preprocessor\" foreground=\"green\"/>\n"
"\n"
" <!-- Other -->\n"
" <style name=\"def:error\" foreground=\"red\"/>\n"
" <style name=\"def:warning\" foreground=\"orange\"/>\n"
" <style name=\"def:note\" foreground=\"black\" background=\"yellow\"/>\n"

8
src/source.cc

@ -618,8 +618,12 @@ void Source::ClangViewParse::update_syntax() {
//ranges.emplace_back(token.offsets, (int) token.get_cursor().get_kind());
if(token.get_kind()==1) // KeywordToken
ranges.emplace_back(token.offsets, 702);
else if(token.get_kind()==2) // IdentifierToken
ranges.emplace_back(token.offsets, (int) token.get_cursor().get_kind()); //TODO: Need to get type of referenced token if any
else if(token.get_kind()==2) {// IdentifierToken
auto kind=(int)token.get_cursor().get_kind();
if(kind==101 || kind==102)
kind=(int)token.get_cursor().get_referenced().get_kind();
ranges.emplace_back(token.offsets, kind); //TODO: Need to get type of referenced token if any
}
else if(token.get_kind()==3) // LiteralToken
ranges.emplace_back(token.offsets, 109);
else if(token.get_kind()==4) // CommentToken

Loading…
Cancel
Save