# HG changeset patch # User Mikael Berthe # Date 1301225708 -7200 # Node ID 0870005f7efc2cbf3b77550d3dd51f6510c905d4 # Parent b0470ef8669b49f669de24cf705240e858892201 Add command /iline clear_history diff -r b0470ef8669b -r 0870005f7efc mcabber/doc/help/cs/hlp_iline.txt --- a/mcabber/doc/help/cs/hlp_iline.txt Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/doc/help/cs/hlp_iline.txt Sun Mar 27 13:35:08 2011 +0200 @@ -7,6 +7,7 @@ /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert + /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline @@ -58,6 +59,8 @@ Akceptuje řádek a vloží následující řádek z historie příkazů na vstupní řádek. /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). +/iline clear_history + Clear the command line history /iline compl_do Doplní aktuální slovo na příkazovém řádku. /iline compl_cancel diff -r b0470ef8669b -r 0870005f7efc mcabber/doc/help/de/hlp_iline.txt --- a/mcabber/doc/help/de/hlp_iline.txt Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/doc/help/de/hlp_iline.txt Sun Mar 27 13:35:08 2011 +0200 @@ -7,6 +7,7 @@ /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert + /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline @@ -61,6 +62,8 @@ Zeile akzeptieren und die nächste Zeile aus der History in die Eingabezeile schreiben /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). +/iline clear_history + Clear the command line history /iline compl_do Das derzeitig ausgewählte Wort vervollständigen /iline compl_cancel diff -r b0470ef8669b -r 0870005f7efc mcabber/doc/help/en/hlp_iline.txt --- a/mcabber/doc/help/en/hlp_iline.txt Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/doc/help/en/hlp_iline.txt Sun Mar 27 13:35:08 2011 +0200 @@ -7,6 +7,7 @@ /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert + /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline @@ -58,6 +59,8 @@ Accept line and put the next history line in the input line /iline iline_insert text Insert some text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). +/iline clear_history + Clear the command line history /iline compl_do Complete current word, in the input line /iline compl_cancel diff -r b0470ef8669b -r 0870005f7efc mcabber/doc/help/fr/hlp_iline.txt --- a/mcabber/doc/help/fr/hlp_iline.txt Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/doc/help/fr/hlp_iline.txt Sun Mar 27 13:35:08 2011 +0200 @@ -7,6 +7,7 @@ /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert + /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline @@ -58,6 +59,8 @@ Accepter/valider la ligne de commande et charger la ligne suivante de l'historique ligne de commande /iline iline_insert texte Insérer le texte dans la ligne de commande, à la position du curseur. Notez que les guillemets doivent être protégés (\"), et que l'écran n'est pas rafraîchi (cf. /screen_refresh). +/iline clear_history + Efface l'historique de la ligne de commande /iline compl_do Compléter le mot actuel dans la ligne de commande /iline compl_cancel diff -r b0470ef8669b -r 0870005f7efc mcabber/doc/help/it/hlp_iline.txt --- a/mcabber/doc/help/it/hlp_iline.txt Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/doc/help/it/hlp_iline.txt Sun Mar 27 13:35:08 2011 +0200 @@ -7,6 +7,7 @@ /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert + /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline @@ -58,6 +59,8 @@ Accetta la linea ad inserisci la prossima linea della history nella riga di input /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). +/iline clear_history + Clear the command line history /iline compl_do Completa la parola corrente nella riga di input /iline compl_cancel diff -r b0470ef8669b -r 0870005f7efc mcabber/doc/help/nl/hlp_iline.txt --- a/mcabber/doc/help/nl/hlp_iline.txt Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/doc/help/nl/hlp_iline.txt Sun Mar 27 13:35:08 2011 +0200 @@ -7,6 +7,7 @@ /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert + /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline @@ -58,6 +59,8 @@ Accepteer regel en plaats de volgende regel uit de geschiedenis op de invoerregel /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). +/iline clear_history + Clear the command line history /iline compl_do Completeer het huidige woord op de invoerregel /iline compl_cancel diff -r b0470ef8669b -r 0870005f7efc mcabber/doc/help/pl/hlp_iline.txt --- a/mcabber/doc/help/pl/hlp_iline.txt Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/doc/help/pl/hlp_iline.txt Sun Mar 27 13:35:08 2011 +0200 @@ -7,6 +7,7 @@ /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert + /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline @@ -58,6 +59,8 @@ Akceptuje linie i wstawia następną z historii do linii komend /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). +/iline clear_history + Clear the command line history /iline compl_do Dopełnia aktualne słowo w linii komend /iline compl_cancel diff -r b0470ef8669b -r 0870005f7efc mcabber/doc/help/ru/hlp_iline.txt --- a/mcabber/doc/help/ru/hlp_iline.txt Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/doc/help/ru/hlp_iline.txt Sun Mar 27 13:35:08 2011 +0200 @@ -7,6 +7,7 @@ /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert + /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline @@ -58,6 +59,8 @@ Закончить ввод, отправить строку текущему пользователю, поместить следующую строку истории в строку ввода /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). +/iline clear_history + Clear the command line history /iline compl_do Завершить текущее слово в строке ввода /iline compl_cancel diff -r b0470ef8669b -r 0870005f7efc mcabber/doc/help/uk/hlp_iline.txt --- a/mcabber/doc/help/uk/hlp_iline.txt Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/doc/help/uk/hlp_iline.txt Sun Mar 27 13:35:08 2011 +0200 @@ -7,6 +7,7 @@ /ILINE iline_start|iline_end|iline_fdel|iline_bdel /ILINE iline_accept|iline_accept_down_hist /ILINE iline_insert + /ILINE clear_history /ILINE compl_do|compl_cancel /ILINE send_multiline @@ -58,6 +59,8 @@ Перейти до наступного рядка в історії, затвердивши поточний. /iline iline_insert text Insert text in the input line, at the current position. Please note that quotes have to be escaped, and that the screen is not refreshed (use /screen_refresh). +/iline clear_history + Clear the command line history /iline compl_do Доповнити поточне слово. /iline compl_cancel diff -r b0470ef8669b -r 0870005f7efc mcabber/mcabber/commands.c --- a/mcabber/mcabber/commands.c Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/mcabber/commands.c Sun Mar 27 13:35:08 2011 +0200 @@ -3877,6 +3877,8 @@ readline_cancel_completion(); } else if (!strcasecmp(arg, "compl_do")) { readline_do_completion(); + } else if (!strcasecmp(arg, "clear_history")) { + readline_clear_history(); } else { char **paramlst; char *subcmd; diff -r b0470ef8669b -r 0870005f7efc mcabber/mcabber/screen.c --- a/mcabber/mcabber/screen.c Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/mcabber/screen.c Sun Mar 27 13:35:08 2011 +0200 @@ -3206,7 +3206,7 @@ // scr_cmdhisto_addline() // Add a line to the inputLine history -static inline void scr_cmdhisto_addline(char *line) +static void scr_cmdhisto_addline(char *line) { int max_histo_lines; @@ -3231,6 +3231,19 @@ cmdhisto_nblines++; } +// scr_cmdhisto_reset() +// Reset the inputLine history +static void scr_cmdhisto_reset(void) +{ + while (cmdhisto_nblines) { + g_free(cmdhisto->data); + cmdhisto = g_list_delete_link(cmdhisto, cmdhisto); + cmdhisto_nblines--; + } + cmdhisto_backup[0] = 0; + cmdhisto_cur = NULL; +} + // scr_cmdhisto_prev() // Look for previous line beginning w/ the given mask in the inputLine history // Returns NULL if none found @@ -3496,6 +3509,13 @@ return 0; } +// readline_clear_history() +// Clear command line history. +void readline_clear_history(void) +{ + scr_cmdhisto_reset(); +} + void readline_cancel_completion(void) { scr_cancel_current_completion(); diff -r b0470ef8669b -r 0870005f7efc mcabber/mcabber/screen.h --- a/mcabber/mcabber/screen.h Sun Mar 27 12:45:41 2011 +0200 +++ b/mcabber/mcabber/screen.h Sun Mar 27 13:35:08 2011 +0200 @@ -175,6 +175,7 @@ void readline_backward_char(void); void readline_forward_char(void); int readline_accept_line(int down_history); +void readline_clear_history(void); void readline_cancel_completion(void); void readline_do_completion(void); void readline_refresh_screen(void);