From 8f6ee6cb9b3292a91ac783c25508a701d34400f9 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 2 Oct 2001 19:27:47 +0000 Subject: Don't handle control-enter if allow_newlines is off. Fixes Ximian bug 2001-10-02 Christopher James Lahey * gal/util/e-text-event-processor-emacs-like.c (e_text_event_processor_emacs_like_event): Don't handle control-enter if allow_newlines is off. Fixes Ximian bug #3742. svn path=/trunk/; revision=13345 --- e-util/e-text-event-processor-emacs-like.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'e-util/e-text-event-processor-emacs-like.c') diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c index f3077ae42f..652e4b9ff6 100644 --- a/e-util/e-text-event-processor-emacs-like.c +++ b/e-util/e-text-event-processor-emacs-like.c @@ -306,13 +306,23 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventPro case GDK_Return: case GDK_KP_Enter: if (tep->allow_newlines) { - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "\n"; + if (key.state & GDK_CONTROL_MASK) { + command.action = E_TEP_ACTIVATE; + command.position = E_TEP_SELECTION; + } else { + command.action = E_TEP_INSERT; + command.position = E_TEP_SELECTION; + command.value = 1; + command.string = "\n"; + } } else { - command.action = E_TEP_ACTIVATE; - command.position = E_TEP_SELECTION; + if (key.state & GDK_CONTROL_MASK) { + command.action = E_TEP_NOP; + command.position = E_TEP_SELECTION; + } else { + command.action = E_TEP_ACTIVATE; + command.position = E_TEP_SELECTION; + } } break; case GDK_Escape: -- cgit v1.2.3