1
0
mirror of https://github.com/irssi/irssi.git synced 2024-08-04 03:34:18 -04:00

Don't add command to history if it's already in there as last entry. patch by peder.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2281 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-12-27 11:37:31 +00:00 committed by cras
parent c15769685c
commit db907c209f

View File

@ -41,6 +41,10 @@ void command_history_add(HISTORY_REC *history, const char *text)
g_return_if_fail(history != NULL);
g_return_if_fail(text != NULL);
link = g_list_last(history->list);
if (link != NULL && strcmp(link->data, text) == 0)
return; /* same as previous entry */
if (settings_get_int("max_command_history") < 1 ||
history->lines < settings_get_int("max_command_history"))
history->lines++;