Browse Source

Further cleanup of styles.

merge-requests/365/head
eidheim 10 years ago
parent
commit
a59b0fd13f
  1. 26
      src/files.h
  2. 5
      src/source.cc

26
src/files.h

@ -10,9 +10,10 @@ const std::string configjson =
" \"font\": \"Monospace\", //Use \"\" for default font, and for instance \"Monospace 12\" to also set size.\n" " \"font\": \"Monospace\", //Use \"\" for default font, and for instance \"Monospace 12\" to also set size.\n"
" \"clang_types\": {\n" " \"clang_types\": {\n"
" \"43\": \"def:type\",\n" " \"43\": \"def:type\",\n"
" \"46\": \"def:preprocessor\",\n" " \"45\": \"def:type\",\n"
" \"46\": \"def:identifier\",\n"
" \"109\": \"def:constant\",\n" " \"109\": \"def:constant\",\n"
" \"500\": \"c:included-file\",\n" " \"500\": \"def:preprocessor\",\n"
" \"702\": \"def:statement\",\n" " \"702\": \"def:statement\",\n"
" \"705\": \"def:comment\"\n" " \"705\": \"def:comment\"\n"
" },\n" " },\n"
@ -130,11 +131,12 @@ const std::string juci_style =
" <color name=\"white\" value=\"#FFFFFF\"/>\n" " <color name=\"white\" value=\"#FFFFFF\"/>\n"
" <color name=\"black\" value=\"#000000\"/>\n" " <color name=\"black\" value=\"#000000\"/>\n"
" <color name=\"gray\" value=\"#888888\"/>\n" " <color name=\"gray\" value=\"#888888\"/>\n"
" <color name=\"red\" value=\"#FF0000\"/>\n" " <color name=\"red\" value=\"#CC0000\"/>\n"
" <color name=\"green\" value=\"#008800\"/>\n" " <color name=\"green\" value=\"#008800\"/>\n"
" <color name=\"blue\" value=\"#0000FF\"/>\n" " <color name=\"blue\" value=\"#0000FF\"/>\n"
" <color name=\"yellow\" value=\"#FFFF00\"/>\n" " <color name=\"yellow\" value=\"#FFFF00\"/>\n"
" <color name=\"orange\" value=\"#FF8800\"/>\n" " <color name=\"orange\" value=\"#FF8800\"/>\n"
" <color name=\"purple\" value=\"#990099\"/>\n"
"\n" "\n"
" <!-- Global Settings -->\n" " <!-- Global Settings -->\n"
" <style name=\"current-line\" background=\"#eeeeec\"/>\n" " <style name=\"current-line\" background=\"#eeeeec\"/>\n"
@ -147,21 +149,15 @@ const std::string juci_style =
" <!-- Search Matching -->\n" " <!-- Search Matching -->\n"
" <style name=\"search-match\" background=\"yellow\"/>\n" " <style name=\"search-match\" background=\"yellow\"/>\n"
"\n" "\n"
" <!-- Comments -->\n" " <!-- Programming Language -->\n"
" <style name=\"def:comment\" foreground=\"gray\"/>\n" " <style name=\"def:comment\" foreground=\"gray\"/>\n"
"\n" " <style name=\"def:constant\" foreground=\"red\"/>\n"
" <!-- Constants -->\n"
" <style name=\"def:constant\" foreground=\"#CC0000\"/>\n"
"\n"
" <!-- Statements -->\n"
" <style name=\"def:statement\" foreground=\"blue\"/>\n" " <style name=\"def:statement\" foreground=\"blue\"/>\n"
" <style name=\"def:type\" foreground=\"blue\"/>\n"
" <style name=\"def:identifier\" foreground=\"purple\"/>\n"
" <style name=\"def:preprocessor\" foreground=\"green\"/>\n"
"\n" "\n"
" <!-- Types -->\n" " <!-- Other -->\n"
" <style name=\"def:type\" foreground=\"#0066FF\"/>\n"
"\n"
" <!-- Others -->\n"
" <style name=\"c:included-file\" foreground=\"green\"/>\n"
" <style name=\"def:preprocessor\" foreground=\"#990099\"/>\n"
" <style name=\"def:error\" foreground=\"red\"/>\n" " <style name=\"def:error\" foreground=\"red\"/>\n"
" <style name=\"def:warning\" foreground=\"orange\"/>\n" " <style name=\"def:warning\" foreground=\"orange\"/>\n"
" <style name=\"def:note\" foreground=\"black\" background=\"yellow\"/>\n" " <style name=\"def:note\" foreground=\"black\" background=\"yellow\"/>\n"

5
src/source.cc

@ -394,7 +394,9 @@ clang::Index Source::ClangViewParse::clang_index(0, 0);
Source::ClangViewParse::ClangViewParse(const boost::filesystem::path &file_path, const boost::filesystem::path& project_path): Source::ClangViewParse::ClangViewParse(const boost::filesystem::path &file_path, const boost::filesystem::path& project_path):
Source::View(file_path), project_path(project_path) { Source::View(file_path), project_path(project_path) {
auto scheme = get_source_buffer()->get_style_scheme(); auto scheme = get_source_buffer()->get_style_scheme();
auto tag_table=get_buffer()->get_tag_table();
for (auto &item : Singleton::Config::source()->clang_types) { for (auto &item : Singleton::Config::source()->clang_types) {
if(!tag_table->lookup(item.second)) {
auto style = scheme->get_style(item.second); auto style = scheme->get_style(item.second);
auto tag = get_source_buffer()->create_tag(item.second); auto tag = get_source_buffer()->create_tag(item.second);
if (style) { if (style) {
@ -412,6 +414,7 @@ Source::View(file_path), project_path(project_path) {
} else } else
DEBUG("Style " + item.second + " not found in " + scheme->get_name()); DEBUG("Style " + item.second + " not found in " + scheme->get_name());
} }
}
INFO("Tagtable filled"); INFO("Tagtable filled");
//Create tags for diagnostic warnings and errors: //Create tags for diagnostic warnings and errors:
@ -634,7 +637,7 @@ void Source::ClangViewParse::update_syntax() {
try { try {
last_syntax_tags.emplace(Singleton::Config::source()->clang_types.at(type)); last_syntax_tags.emplace(Singleton::Config::source()->clang_types.at(type));
} catch (std::exception) { } 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;
continue; continue;
} }

Loading…
Cancel
Save