From b657c0ff8cd9fa7e2b48ac4e6904b6321b59e76d Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Sun, 26 Jun 2005 13:10:37 +0000 Subject: [PATCH] ctrl+up/down now put the cursor after the message with and with a space [thanks to rohan and me] --- src/chat.py | 1 + src/groupchat_window.py | 2 ++ src/tabbed_chat_window.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/chat.py b/src/chat.py index bd0dc04b9..08330b7bd 100644 --- a/src/chat.py +++ b/src/chat.py @@ -875,6 +875,7 @@ class Chat: self.sent_history[jid][i] = self.sent_history[jid][i+1] self.sent_history[jid][max_size - 1] = message else: + message += ' ' # append message with a space self.sent_history[jid].append(message) self.sent_history_pos[jid] = size + 1 diff --git a/src/groupchat_window.py b/src/groupchat_window.py index c2b675758..9fba1b759 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -482,9 +482,11 @@ class GroupchatWindow(chat.Chat): elif event.keyval == gtk.keysyms.Up: if event.state & gtk.gdk.CONTROL_MASK: #Ctrl+UP self.sent_messages_scroll(room_jid, 'up', widget.get_buffer()) + return True # override the default gtk+ thing for ctrl+up elif event.keyval == gtk.keysyms.Down: if event.state & gtk.gdk.CONTROL_MASK: #Ctrl+Down self.sent_messages_scroll(room_jid, 'down', widget.get_buffer()) + return True # override the default gtk+ thing for ctrl+down else: self.last_key_tabs[room_jid] = False diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index 8c572993a..44acfe840 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -306,9 +306,11 @@ class TabbedChatWindow(chat.Chat): elif event.keyval == gtk.keysyms.Up: if event.state & gtk.gdk.CONTROL_MASK: #Ctrl+UP self.sent_messages_scroll(jid, 'up', widget.get_buffer()) + return True # override the default gtk+ thing for ctrl+up elif event.keyval == gtk.keysyms.Down: if event.state & gtk.gdk.CONTROL_MASK: #Ctrl+Down self.sent_messages_scroll(jid, 'down', widget.get_buffer()) + return True # override the default gtk+ thing for ctrl+down def send_message(self, message): """Send the message given in the args"""