gtksourceview r1953 - in trunk: . gtksourceview
- From: pborelli svn gnome org
- To: svn-commits-list gnome org
- Subject: gtksourceview r1953 - in trunk: . gtksourceview
- Date: Thu, 5 Jun 2008 10:12:00 +0000 (UTC)
Author: pborelli
Date: Thu Jun 5 10:11:59 2008
New Revision: 1953
URL: http://svn.gnome.org/viewvc/gtksourceview?rev=1953&view=rev
Log:
2008-06-05 Paolo Borelli <pborelli katamail com>
* gtksourceview/gtksourceview.c: do not (un)indent if the view is
not editable. Bug #536554.
Modified:
trunk/ChangeLog
trunk/gtksourceview/gtksourceview.c
Modified: trunk/gtksourceview/gtksourceview.c
==============================================================================
--- trunk/gtksourceview/gtksourceview.c (original)
+++ trunk/gtksourceview/gtksourceview.c Thu Jun 5 10:11:59 2008
@@ -2677,10 +2677,13 @@
GtkTextMark *mark;
guint modifiers;
gint key;
+ gboolean editable;
view = GTK_SOURCE_VIEW (widget);
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
+ editable = gtk_text_view_get_editable (GTK_TEXT_VIEW (widget));
+
/* Be careful when testing for modifier state equality:
* caps lock, num lock,etc need to be taken into account */
modifiers = gtk_accelerator_get_default_mod_mask ();
@@ -2733,7 +2736,8 @@
*/
if ((key == GDK_Tab || key == GDK_KP_Tab || key == GDK_ISO_Left_Tab) &&
((event->state & modifiers) == 0 ||
- (event->state & modifiers) == GDK_SHIFT_MASK))
+ (event->state & modifiers) == GDK_SHIFT_MASK) &&
+ editable)
{
GtkTextIter s, e;
gboolean has_selection;
@@ -2768,7 +2772,8 @@
/* Alt+up/down moves the lines */
if ((key == GDK_Up || key == GDK_Down) &&
- ((event->state & modifiers) == GDK_MOD1_MASK))
+ ((event->state & modifiers) == GDK_MOD1_MASK) &&
+ editable)
{
move_lines (GTK_TEXT_VIEW (widget), key == GDK_Down);
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]