# HG changeset patch # User mikael@frmp8452 # Date 1120302311 -3600 # Node ID 1bcc3eec08f07d87004c07e4426765d2ddba45d9 # Parent ab6f83a82811aa5e997c03e3484f3569ad664e36 Add Ctrl-o: accept-line-and-down-history diff -r ab6f83a82811 -r 1bcc3eec08f0 mcabber/doc/mcabber.1 --- a/mcabber/doc/mcabber.1 Fri Jul 01 23:50:08 2005 +0100 +++ b/mcabber/doc/mcabber.1 Sat Jul 02 12:05:11 2005 +0100 @@ -98,6 +98,8 @@ Ctrl\-t Transpose chars +Ctrl\-o Accept line and put the next history line in the input line (accept\-line\-and\-down\-history) + Ctrl\-q Jump to the next unread message diff -r ab6f83a82811 -r 1bcc3eec08f0 mcabber/doc/mcabber.1.html --- a/mcabber/doc/mcabber.1.html Fri Jul 01 23:50:08 2005 +0100 +++ b/mcabber/doc/mcabber.1.html Sat Jul 02 12:05:11 2005 +0100 @@ -172,6 +172,14 @@ +Ctrl-o + + +Accept line and put the next history line in the input line (accept-line-and-down-history) + + + + Ctrl-q @@ -436,7 +444,7 @@ diff -r ab6f83a82811 -r 1bcc3eec08f0 mcabber/doc/mcabber.1.txt --- a/mcabber/doc/mcabber.1.txt Fri Jul 01 23:50:08 2005 +0100 +++ b/mcabber/doc/mcabber.1.txt Sat Jul 02 12:05:11 2005 +0100 @@ -71,6 +71,7 @@ Ctrl-k:: Delete from the cursor to the end of line Ctrl-w:: Backward kill word Ctrl-t:: Transpose chars +Ctrl-o:: Accept line and put the next history line in the input line (accept-line-and-down-history) Ctrl-q:: Jump to the next unread message COMMANDS diff -r ab6f83a82811 -r 1bcc3eec08f0 mcabber/src/screen.c --- 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: {