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

sourceview: formating improvements for keywords

parent 56533c64
......@@ -69,8 +69,8 @@ public class GVls.GScanner : Object {
if (f == null) {
f = GLib.File.new_for_uri (filename);
}
var loc = new GLocation.from_values (f, begin.line - 1, begin.column - 1,
end.line - 1, end.column);
var loc = new GLocation.from_values (f, begin.line, begin.column,
end.line, end.column);
switch (token) {
case Vala.TokenType.ABSTRACT:
case Vala.TokenType.AS:
......
......@@ -131,10 +131,7 @@ lib = library('gvls', gvls_sources,
g_ir_compiler = find_program('g-ir-compiler', required: false)
if gtk_dep.found ()
gtksourceview_dep = dependency ('gtksourceview-3.0')
subdir('ui')
endif
if g_ir_compiler.found()
......
......@@ -18,6 +18,7 @@
using GVls;
using GVlsui;
using Gtk;
using Pango;
public class GVlsui.SourceView : Gtk.SourceView
{
......@@ -31,11 +32,11 @@ public class GVlsui.SourceView : Gtk.SourceView
_server = value;
_prov.server = _server;
get_buffer ().create_tag ("bold", "weight", Pango.Weight.BOLD);
get_buffer ().create_tag ("type", "weight", Pango.Weight.BOLD, "foreground", "#3465a4");
get_buffer ().create_tag ("keyword", "weight", Pango.Weight.NORMAL, "foreground", "#4e9a06");
get_buffer ().create_tag ("type", "weight", Pango.Weight.BOLD, "foreground", "#204a87");
get_buffer ().create_tag ("keyword", "weight", Pango.Weight.BOLD, "foreground", "#a40000");
get_buffer ().create_tag ("text", "weight", Pango.Weight.NORMAL, "foreground", "#729fcf");
get_buffer ().create_tag ("number", "weight", Pango.Weight.BOLD, "foreground", "#ad7fa8");
get_buffer ().create_tag ("method", "weight", Pango.Weight.NORMAL, "foreground", "#ad7fa8");
get_buffer ().create_tag ("method", "weight", Pango.Weight.NORMAL, "foreground", "#3465a4");
}
}
......@@ -77,9 +78,9 @@ 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, sym.range.start.character);
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, sym.range.end.character);
get_buffer ().get_iter_at_line_offset (out end, sym.range.end.line - 1, sym.range.end.character);
message ("Current Symbol: %s - Loc: %s", sym.name, sym.range.to_string ());
switch (sym.kind) {
case GVls.SymbolKind.KEY:
......@@ -93,7 +94,7 @@ public class GVlsui.SourceView : Gtk.SourceView
get_buffer ().apply_tag_by_name ("type", start, end);
break;
case GVls.SymbolKind.METHOD:
get_buffer ().apply_tag_by_name ("type", start, end);
get_buffer ().apply_tag_by_name ("method", start, end);
break;
}
}
......
gio-2.0
gee-0.8
\ No newline at end of file
gee-0.8
gtk-3.0
gtksourceview-3.0
pango
gvls-0.8
\ No newline at end of file
......@@ -5,8 +5,6 @@ UI_TYPELIB_NAME= UI_CAMELCASE_VERSIONED_NAME+'.typelib'
UI_VAPI_NAME = UI_VERSIONED_NAME+'.vapi'
UI_PROJECT_NAME = PROJECT_NAME+'ui'
dependency('valadoc-@0@'.format (vala_version))
confui = configuration_data()
confui.set('prefix', get_option('prefix'))
confui.set('libdir', '${exec_prefix}/'+get_option ('libdir'))
......@@ -121,10 +119,15 @@ inc_libuih = include_directories ('.')
inc_libuih_dep = declare_dependency (include_directories : inc_libuih)
dependency('valadoc-@0@'.format (vala_version))
pango_dep = dependency('pango')
gtksourceview_dep = dependency ('gtksourceview-3.0')
gvlsui_deps = [
gvls_deps,
gtk_dep,
gtksourceview_dep,
pango_dep,
inc_libh_dep,
inc_libuih_dep
]
......
......@@ -44,7 +44,6 @@ class Tests {
message ("Setting Text to Buffer");
w.buffer.text = """
public class Test {}
public class ATest {}
""";
});
win.show_all ();
......
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