From 7fe4cd958e6e43c45fdc671998293a5b2a3b99dc Mon Sep 17 00:00:00 2001 From: Alex Mauer Date: Sat, 3 Sep 2005 18:18:33 +0000 Subject: [PATCH] Don't lose the original message when scrolling down from the end in the sent message history. --- src/chat.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/chat.py b/src/chat.py index 26ef8a1b6..f094634ee 100644 --- a/src/chat.py +++ b/src/chat.py @@ -1208,18 +1208,16 @@ class Chat: def sent_messages_scroll(self, jid, direction, conv_buf): size = len(self.sent_history[jid]) + if self.typing_new[jid]: + #user was typing something and then went into history, so save + #whatever is already typed + start_iter = conv_buf.get_start_iter() + end_iter = conv_buf.get_end_iter() + self.orig_msg[jid] = conv_buf.get_text(start_iter, end_iter, 0).decode('utf-8') + self.typing_new[jid] = False if direction == 'up': if self.sent_history_pos[jid] == 0: return - - if self.typing_new[jid]: - #user was typing something and then went into history, so save - #whatever is already typed - start_iter = conv_buf.get_start_iter() - end_iter = conv_buf.get_end_iter() - self.orig_msg[jid] = conv_buf.get_text(start_iter, end_iter, 0).decode('utf-8') - self.typing_new[jid] = False - self.sent_history_pos[jid] = self.sent_history_pos[jid] - 1 conv_buf.set_text(self.sent_history[jid][self.sent_history_pos[jid]])