[gnome-builder] editorconfig: support max_line_length



commit ba940b8abde5f0622f2a2fbd9eba8a46f8309ec5
Author: Christian Hergert <christian hergert me>
Date:   Fri Apr 10 22:41:28 2015 -0700

    editorconfig: support max_line_length
    
    The vim editorconfig plugin supports this "emerging" property name. I'm
    going to go ahead and implement it as well to map to our
    "right-margin-position".

 .editorconfig                                      |    1 +
 libide/editorconfig/editorconfig-glib.c            |    1 +
 .../editorconfig/ide-editorconfig-file-settings.c  |    2 ++
 3 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/.editorconfig b/.editorconfig
index 945bd37..17aa167 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -7,6 +7,7 @@ tab_width = 2
 indent_size = 2
 insert_trailing_newline = true
 indent_style = space
+max_line_length = 100
 
 [*.py]
 indent_size = 4
diff --git a/libide/editorconfig/editorconfig-glib.c b/libide/editorconfig/editorconfig-glib.c
index acf0c12..ac0df94 100644
--- a/libide/editorconfig/editorconfig-glib.c
+++ b/libide/editorconfig/editorconfig-glib.c
@@ -99,6 +99,7 @@ editorconfig_glib_read (GFile         *file,
       editorconfig_handle_get_name_value (handle, i, &key, &valuestr);
 
       if ((g_strcmp0 (key, "tab_width") == 0) ||
+          (g_strcmp0 (key, "max_line_length") == 0) ||
           (g_strcmp0 (key, "indent_size") == 0))
         {
           g_value_init (value, G_TYPE_INT);
diff --git a/libide/editorconfig/ide-editorconfig-file-settings.c 
b/libide/editorconfig/ide-editorconfig-file-settings.c
index e2a26ee..20f6fa3 100644
--- a/libide/editorconfig/ide-editorconfig-file-settings.c
+++ b/libide/editorconfig/ide-editorconfig-file-settings.c
@@ -87,6 +87,8 @@ ide_editorconfig_file_settings_init_worker (GTask        *task,
         g_object_set_property (source_object, "insert_trailing_newline", value);
       else if (g_str_equal (key, "charset"))
         g_object_set_property (source_object, "encoding", value);
+      else if (g_str_equal (key, "max_line_length"))
+        g_object_set_property (source_object, "right-margin-position", value);
       else if (g_str_equal (key, "end_of_line"))
         {
           GtkSourceNewlineType newline_type = GTK_SOURCE_NEWLINE_TYPE_LF;


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