Commit b59d4bef authored by Ole Christian Eidheim's avatar Ole Christian Eidheim
Browse files

Fixed markup on ctags results

parent 3498b4bf
Pipeline #198564069 passed with stages
in 16 minutes and 31 seconds
......@@ -138,6 +138,7 @@ Ctags::Location Ctags::get_location(const std::string &line_, bool add_markup, b
if(add_markup) {
location.source = Glib::Markup::escape_text(location.source);
std::string symbol = Glib::Markup::escape_text(location.symbol);
auto symbol_size = symbol.size();
if(symbol_ends_with_open_parenthesis)
symbol += '(';
bool first = true;
......@@ -145,9 +146,9 @@ Ctags::Location Ctags::get_location(const std::string &line_, bool add_markup, b
for(size_t i = 0; i < location.source.size(); i++) {
if(!escaped) {
if(starts_with(location.source, i, symbol)) {
location.source.insert(i + symbol.size(), "</b>");
location.source.insert(i + symbol_size, "</b>");
location.source.insert(i, "<b>");
i += 7 + symbol.size() - 1;
i += 7 + symbol_size - 1;
first = false;
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment