diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-10-03 19:59:35 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-10-03 19:59:35 +0200 |
commit | 2784959fc17c9b43cb438feeb573574e1e53f5a2 (patch) | |
tree | bd55ca4614d74a1531279084f71078af3868c973 /source | |
parent | 7081b56aca059574f8ef7bcdb169ef1979ae9f67 (diff) |
Allow maximum history size to be configured.
Fixes: #613
Diffstat (limited to 'source')
-rw-r--r-- | source/history.c | 4 | ||||
-rw-r--r-- | source/xrmoptions.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/history.c b/source/history.c index 6b4a9794..4966ffe2 100644 --- a/source/history.c +++ b/source/history.c @@ -38,8 +38,6 @@ #include "history.h" #include "settings.h" -#define HISTORY_MAX_ENTRIES 25 - /** * History element */ @@ -70,7 +68,7 @@ static void __history_write_element_list ( FILE *fd, _element **list, unsigned i int min_value = list[length - 1]->index; // Set the max length of the list. - length = ( length > HISTORY_MAX_ENTRIES ) ? HISTORY_MAX_ENTRIES : length; + length = ( length > config.max_history_size ) ? config.max_history_size: length; // Write out entries. for ( unsigned int iter = 0; iter < length; iter++ ) { diff --git a/source/xrmoptions.c b/source/xrmoptions.c index 404886c4..74a95853 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -204,6 +204,8 @@ static XrmOption xrmOptions[] = { "Color scheme window", CONFIG_DEFAULT }, { xrm_String, "plugin-path", { .str = &config.plugin_path }, NULL, "Directory containing plugins", CONFIG_DEFAULT }, + { xrm_Number, "max-history-size", { .num = &config.max_history_size }, NULL, + "Max history size (WARNING: can cause slowdowns when set to high).", CONFIG_DEFAULT }, }; /** Dynamic array of extra options */ |