|
|
|
@ -463,28 +463,30 @@ void Source::View::configure() { |
|
|
|
std::set<std::string> out; |
|
|
|
std::set<std::string> out; |
|
|
|
qi::phrase_parse(Config::get().source.show_whitespace_characters.begin(), Config::get().source.show_whitespace_characters.end(), (+(~qi::char_(','))) % ',', qi::space, out); |
|
|
|
qi::phrase_parse(Config::get().source.show_whitespace_characters.begin(), Config::get().source.show_whitespace_characters.end(), (+(~qi::char_(','))) % ',', qi::space, out); |
|
|
|
|
|
|
|
|
|
|
|
auto space_drawer = gtk_source_view_get_space_drawer(gobj()); |
|
|
|
|
|
|
|
int locations = GTK_SOURCE_SPACE_LOCATION_NONE; |
|
|
|
int locations = GTK_SOURCE_SPACE_LOCATION_NONE; |
|
|
|
if(out.count("leading") > 0) |
|
|
|
int types = GTK_SOURCE_SPACE_TYPE_NONE; |
|
|
|
|
|
|
|
for(auto &e : out) { |
|
|
|
|
|
|
|
if(e == "leading") |
|
|
|
locations |= GTK_SOURCE_SPACE_LOCATION_LEADING; |
|
|
|
locations |= GTK_SOURCE_SPACE_LOCATION_LEADING; |
|
|
|
if(out.count("text") > 0) |
|
|
|
else if(e == "text") |
|
|
|
locations |= GTK_SOURCE_SPACE_LOCATION_INSIDE_TEXT; |
|
|
|
locations |= GTK_SOURCE_SPACE_LOCATION_INSIDE_TEXT; |
|
|
|
if(out.count("trailing") > 0) |
|
|
|
else if(e == "trailing") |
|
|
|
locations |= GTK_SOURCE_SPACE_LOCATION_TRAILING; |
|
|
|
locations |= GTK_SOURCE_SPACE_LOCATION_TRAILING; |
|
|
|
if(out.count("all") > 0) |
|
|
|
else if(e == "all") |
|
|
|
locations |= GTK_SOURCE_SPACE_LOCATION_ALL; |
|
|
|
locations |= GTK_SOURCE_SPACE_LOCATION_ALL; |
|
|
|
int types = GTK_SOURCE_SPACE_TYPE_NONE; |
|
|
|
else if(e == "space") |
|
|
|
if(out.count("space") > 0) |
|
|
|
|
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_SPACE; |
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_SPACE; |
|
|
|
if(out.count("tab") > 0) |
|
|
|
else if(e == "tab") |
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_TAB; |
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_TAB; |
|
|
|
if(out.count("newline") > 0) |
|
|
|
else if(e == "newline") |
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_NEWLINE; |
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_NEWLINE; |
|
|
|
if(out.count("nbsp") > 0) |
|
|
|
else if(e == "nbsp") |
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_NBSP; |
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_NBSP; |
|
|
|
if(out.count("all") > 0) |
|
|
|
else if(e == "all") |
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_ALL; |
|
|
|
types |= GTK_SOURCE_SPACE_TYPE_ALL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto space_drawer = gtk_source_view_get_space_drawer(gobj()); |
|
|
|
if(locations != GTK_SOURCE_SPACE_LOCATION_NONE || types != GTK_SOURCE_SPACE_TYPE_NONE) { |
|
|
|
if(locations != GTK_SOURCE_SPACE_LOCATION_NONE || types != GTK_SOURCE_SPACE_TYPE_NONE) { |
|
|
|
if(locations == GTK_SOURCE_SPACE_LOCATION_NONE) |
|
|
|
if(locations == GTK_SOURCE_SPACE_LOCATION_NONE) |
|
|
|
locations = GTK_SOURCE_SPACE_LOCATION_ALL; |
|
|
|
locations = GTK_SOURCE_SPACE_LOCATION_ALL; |
|
|
|
|