Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/screen.c @ 1190:be06bbe7e449
Add readline_hist_beginning_search_bwd/fwd functions
These function match the actual behaviour of Up/Down in mcabber.
/iline hist_prev|hist_next now have a more traditional behaviour
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 20 Apr 2007 19:06:24 +0200 |
parents | 16abe7ec3056 |
children | e802ec0c02d2 |
comparison
equal
deleted
inserted
replaced
1189:a0722fce1786 | 1190:be06bbe7e449 |
---|---|
342 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline bchar"); | 342 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline bchar"); |
343 g_string_printf(sbuf, "%d", KEY_RIGHT); | 343 g_string_printf(sbuf, "%d", KEY_RIGHT); |
344 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline fchar"); | 344 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline fchar"); |
345 settings_set(SETTINGS_TYPE_BINDING, "7", "iline compl_cancel"); // Ctrl-g | 345 settings_set(SETTINGS_TYPE_BINDING, "7", "iline compl_cancel"); // Ctrl-g |
346 g_string_printf(sbuf, "%d", KEY_UP); | 346 g_string_printf(sbuf, "%d", KEY_UP); |
347 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline hist_prev"); | 347 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, |
348 "iline hist_beginning_search_bwd"); | |
348 g_string_printf(sbuf, "%d", KEY_DOWN); | 349 g_string_printf(sbuf, "%d", KEY_DOWN); |
349 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "iline hist_next"); | 350 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, |
351 "iline hist_beginning_search_fwd"); | |
350 g_string_printf(sbuf, "%d", KEY_PPAGE); | 352 g_string_printf(sbuf, "%d", KEY_PPAGE); |
351 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "roster up"); | 353 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "roster up"); |
352 g_string_printf(sbuf, "%d", KEY_NPAGE); | 354 g_string_printf(sbuf, "%d", KEY_NPAGE); |
353 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "roster down"); | 355 settings_set(SETTINGS_TYPE_BINDING, sbuf->str, "roster down"); |
354 g_string_printf(sbuf, "%d", KEY_HOME); | 356 g_string_printf(sbuf, "%d", KEY_HOME); |
2566 top_panel(chatPanel); | 2568 top_panel(chatPanel); |
2567 top_panel(inputPanel); | 2569 top_panel(inputPanel); |
2568 update_panels(); | 2570 update_panels(); |
2569 } | 2571 } |
2570 | 2572 |
2571 void readline_hist_prev(void) | 2573 void readline_hist_beginning_search_bwd(void) |
2572 { | 2574 { |
2573 const char *l = scr_cmdhisto_prev(inputLine, ptr_inputline-inputLine); | 2575 const char *l = scr_cmdhisto_prev(inputLine, ptr_inputline-inputLine); |
2574 if (l) strcpy(inputLine, l); | 2576 if (l) strcpy(inputLine, l); |
2575 } | 2577 } |
2576 | 2578 |
2577 void readline_hist_next(void) | 2579 void readline_hist_beginning_search_fwd(void) |
2578 { | 2580 { |
2579 const char *l = scr_cmdhisto_next(inputLine, ptr_inputline-inputLine); | 2581 const char *l = scr_cmdhisto_next(inputLine, ptr_inputline-inputLine); |
2580 if (l) strcpy(inputLine, l); | 2582 if (l) strcpy(inputLine, l); |
2583 } | |
2584 | |
2585 void readline_hist_prev(void) | |
2586 { | |
2587 const char *l = scr_cmdhisto_prev(inputLine, 0); | |
2588 if (l) { | |
2589 strcpy(inputLine, l); | |
2590 // Set the pointer at the EOL. | |
2591 // We have to move it to BOL first, because we could be too far already. | |
2592 readline_iline_start(); | |
2593 readline_iline_end(); | |
2594 } | |
2595 } | |
2596 | |
2597 void readline_hist_next(void) | |
2598 { | |
2599 const char *l = scr_cmdhisto_next(inputLine, 0); | |
2600 if (l) { | |
2601 strcpy(inputLine, l); | |
2602 // Set the pointer at the EOL. | |
2603 // We have to move it to BOL first, because we could be too far already. | |
2604 readline_iline_start(); | |
2605 readline_iline_end(); | |
2606 } | |
2581 } | 2607 } |
2582 | 2608 |
2583 void readline_backward_kill_char(void) | 2609 void readline_backward_kill_char(void) |
2584 { | 2610 { |
2585 char *src, *c; | 2611 char *src, *c; |