diff console/libgnt/gntentry.c @ 14216:e9dd2f76e61b

[gaim-migrate @ 16897] A couple more keybindings. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 20 Aug 2006 07:11:09 +0000
parents 28269422838f
children e7de1f6d9f35
line wrap: on
line diff
--- a/console/libgnt/gntentry.c	Sun Aug 20 02:24:15 2006 +0000
+++ b/console/libgnt/gntentry.c	Sun Aug 20 07:11:09 2006 +0000
@@ -255,6 +255,16 @@
 			move_forward(entry);
 			return TRUE;
 		}
+		else if (strcmp(text + 1, GNT_KEY_HOME) == 0)
+		{
+			move_start(entry);
+			return TRUE;
+		}
+		else if (strcmp(text + 1, GNT_KEY_END) == 0)
+		{
+			move_end(entry);
+			return TRUE;
+		}
 		else if (strcmp(text + 1, GNT_KEY_CTRL_DOWN) == 0 && entry->histlength)
 		{
 			if (entry->history->prev)
@@ -371,7 +381,14 @@
 				entry->end += len;
 
 				while (str < next)
-					*(entry->cursor++) = *str++;
+				{
+					if (*str == '\r' || *str == '\n')
+						*entry->cursor = ' ';
+					else
+						*entry->cursor = *str;
+					entry->cursor++;
+					str++;
+				}
 
 				while (g_utf8_pointer_to_offset(entry->scroll, entry->cursor) >= widget->priv.width)
 					entry->scroll = g_utf8_find_next_char(entry->scroll, NULL);