Browse Source

Further cleanup of styles.

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

2
src/files.h

@ -12,6 +12,7 @@ const std::string configjson =
" \"43\": \"def:type\",\n"
" \"45\": \"def:type\",\n"
" \"46\": \"def:identifier\",\n"
" \"102\": \"def:function\",\n"
" \"109\": \"def:constant\",\n"
" \"500\": \"def:preprocessor\",\n"
" \"702\": \"def:statement\",\n"
@ -154,6 +155,7 @@ const std::string juci_style =
" <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:identifier\" foreground=\"purple\"/>\n"
" <style name=\"def:preprocessor\" foreground=\"green\"/>\n"
"\n"

8
src/source.cc

@ -614,9 +614,9 @@ std::vector<std::string> Source::ClangViewParse::get_compilation_commands() {
void Source::ClangViewParse::update_syntax() {
std::vector<Source::Range> ranges;
for (auto &token : *clang_tokens) {
if(token.get_kind()==0) // PunctuationToken
ranges.emplace_back(token.offsets, (int) token.get_cursor().get_kind());
else if(token.get_kind()==1) // KeywordToken
//if(token.get_kind()==0) // PunctuationToken
//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());
@ -637,7 +637,7 @@ void Source::ClangViewParse::update_syntax() {
try {
last_syntax_tags.emplace(Singleton::Config::source()->clang_types.at(type));
} catch (std::exception) {
//cout << range.kind << ": " << range.offsets.first.line << ", " << range.offsets.first.index << endl;
//cout << range.kind << ": " << range.offsets.first.line << ", " << range.offsets.first.index << endl; //TODO: remove
continue;
}

Loading…
Cancel
Save