[gtksourceview] buffer: fix default value of max-undo-levels



commit 10586ccf0989153893ec6c8c53877dc322012eae
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Jul 18 22:18:40 2014 +0200

    buffer: fix default value of max-undo-levels
    
    The documentation said that 1000 was the default value, but
    max-undo-levels is not a construct property, and the 1000 value was not
    set in init(). So in reality the default value was 0. And the default
    undo manager has a bug, 0 is the same as -1 (i.e. unlimited).
    
    So by default the undo/redo was unlimited. Now the doc and the code
    reflect that.

 gtksourceview/gtksourcebuffer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index 1f33026..bcb494a 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -307,7 +307,7 @@ gtk_source_buffer_class_init (GtkSourceBufferClass *klass)
                                                             "the buffer"),
                                                           -1,
                                                           G_MAXINT,
-                                                          1000,
+                                                          -1,
                                                           G_PARAM_READWRITE));
 
        g_object_class_install_property (object_class,
@@ -530,6 +530,7 @@ gtk_source_buffer_init (GtkSourceBuffer *buffer)
        priv->bracket_mark_cursor = NULL;
        priv->bracket_mark_match = NULL;
        priv->bracket_match = GTK_SOURCE_BRACKET_MATCH_NONE;
+       priv->max_undo_levels = -1;
 
        priv->source_marks = g_hash_table_new_full (g_str_hash,
                                                    g_str_equal,


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