comparison 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
comparison
equal deleted inserted replaced
14215:e9304dd00992 14216:e9dd2f76e61b
251 return TRUE; 251 return TRUE;
252 } 252 }
253 else if (strcmp(text + 1, GNT_KEY_RIGHT) == 0) 253 else if (strcmp(text + 1, GNT_KEY_RIGHT) == 0)
254 { 254 {
255 move_forward(entry); 255 move_forward(entry);
256 return TRUE;
257 }
258 else if (strcmp(text + 1, GNT_KEY_HOME) == 0)
259 {
260 move_start(entry);
261 return TRUE;
262 }
263 else if (strcmp(text + 1, GNT_KEY_END) == 0)
264 {
265 move_end(entry);
256 return TRUE; 266 return TRUE;
257 } 267 }
258 else if (strcmp(text + 1, GNT_KEY_CTRL_DOWN) == 0 && entry->histlength) 268 else if (strcmp(text + 1, GNT_KEY_CTRL_DOWN) == 0 && entry->histlength)
259 { 269 {
260 if (entry->history->prev) 270 if (entry->history->prev)
369 379
370 memmove(entry->cursor + len, entry->cursor, entry->end - entry->cursor + 1); 380 memmove(entry->cursor + len, entry->cursor, entry->end - entry->cursor + 1);
371 entry->end += len; 381 entry->end += len;
372 382
373 while (str < next) 383 while (str < next)
374 *(entry->cursor++) = *str++; 384 {
385 if (*str == '\r' || *str == '\n')
386 *entry->cursor = ' ';
387 else
388 *entry->cursor = *str;
389 entry->cursor++;
390 str++;
391 }
375 392
376 while (g_utf8_pointer_to_offset(entry->scroll, entry->cursor) >= widget->priv.width) 393 while (g_utf8_pointer_to_offset(entry->scroll, entry->cursor) >= widget->priv.width)
377 entry->scroll = g_utf8_find_next_char(entry->scroll, NULL); 394 entry->scroll = g_utf8_find_next_char(entry->scroll, NULL);
378 395
379 if (entry->ddown) 396 if (entry->ddown)