[gitg] Added line offset and length information in diff



commit b96a7ef4d418c2ea79ea1cbb2fda487571eff392
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Fri Dec 27 18:03:39 2013 +0100

    Added line offset and length information in diff

 libgitg/gitg-diff-view-request-diff.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libgitg/gitg-diff-view-request-diff.vala b/libgitg/gitg-diff-view-request-diff.vala
index 37fa2dd..1c6ab7f 100644
--- a/libgitg/gitg-diff-view-request-diff.vala
+++ b/libgitg/gitg-diff-view-request-diff.vala
@@ -171,8 +171,12 @@ namespace Gitg
                {
                        builder.begin_object();
                        {
-                               builder.set_member_name("type").add_int_value((int)line.get_origin());
+                               var content = line.get_content();
+
+                               builder.set_member_name("type").add_int_value((int64)line.get_origin());
                                builder.set_member_name("content").add_string_value(line.get_text());
+                               
builder.set_member_name("offset").add_int_value((int64)line.get_content_offset());
+                               builder.set_member_name("length").add_int_value((int64)content.length);
                        }
                        builder.end_object();
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]