Commit c4fa3808 authored by Daniel Espinosa Ortiz's avatar Daniel Espinosa Ortiz

sourceview: all tags are removed to be applyied later

parent ff93a752
......@@ -67,9 +67,13 @@ public class GVlsui.SourceView : Gtk.SourceView
public void apply_syntax_highlight () {
GVls.Container syms = _prov.current_server.document_symbols;
message ("DocumentSymbols: %u", syms.get_n_items ());
Gtk.TextBuffer buffer = get_buffer ();
Gtk.TextIter start, end;
buffer.get_start_iter (out start);
buffer.get_end_iter (out end);
buffer.remove_all_tags (start, end);
for (int i = 0; i < syms.get_n_items (); i++) {
Symbol sym = syms.get_item (i) as Symbol;
Gtk.TextIter start;
message ((sym as Symbol).location.to_string ());
if (sym.range.start.line < 0 ||
sym.range.start.character < 0 ||
......@@ -78,9 +82,8 @@ public class GVlsui.SourceView : Gtk.SourceView
message ("Symbol skiped: %s", sym.name);
continue;
}
get_buffer ().get_iter_at_line_offset (out start, sym.range.start.line - 1, sym.range.start.character - 1);
Gtk.TextIter end;
get_buffer ().get_iter_at_line_offset (out end, sym.range.end.line - 1, sym.range.end.character);
buffer.get_iter_at_line_offset (out start, sym.range.start.line - 1, sym.range.start.character - 1);
buffer.get_iter_at_line_offset (out end, sym.range.end.line - 1, sym.range.end.character);
string current_text = get_buffer ().get_text (start, end, false);
if (current_text != sym.name) continue;
message ("Current Symbol: %s - Loc: %s", sym.name, sym.range.to_string ());
......
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