Mercurial > hg
diff mcabber/src/screen.c @ 263:1bcc3eec08f0
Add Ctrl-o: accept-line-and-down-history
author | mikael@frmp8452 |
---|---|
date | Sat, 02 Jul 2005 12:05:11 +0100 |
parents | 259ed1de5bdc |
children | 49e9e02dd6d0 |
line wrap: on
line diff
--- a/mcabber/src/screen.c Fri Jul 01 23:50:08 2005 +0100 +++ b/mcabber/src/screen.c Sat Jul 02 12:05:11 2005 +0100 @@ -1466,15 +1466,28 @@ check_offset(0); break; case '\n': // Enter + case 15: // Ctrl-o ("accept-line-and-down-history") if (process_line(inputLine)) return 255; // Add line to history scr_cmdhisto_addline(inputLine); - cmdhisto_cur = NULL; // Reset the line ptr_inputline = inputLine; *ptr_inputline = 0; inputline_offset = 0; + + if (key == '\n') // Enter + { + // Reset history line pointer + cmdhisto_cur = NULL; + } else { // down-history + // Use next history line instead of a blank line + const char *l = scr_cmdhisto_next("", 0); + if (l) + strcpy(inputLine, l); + // Reset backup history line + cmdhisto_backup[0] = 0; + } break; case KEY_UP: {