Set history size to ${CLING_HISTSIZE}

It was left unset. Then the default hist size was

static_cast<size_t>(-1), which is practically equivalent to unlimited

history size.
This commit is contained in:
Jiang Yi 2022-08-30 14:52:14 +02:00 committed by Axel Naumann
parent c3dd723262
commit da57784037
2 changed files with 12 additions and 0 deletions
lib/UserInterface/textinput

View File

@ -338,6 +338,16 @@ namespace textinput {
[](Display *D) { return D->NotifyWindowChange(); });
}
void TextInput::SetHistoryMaxDepth(size_t maxDepth) const
{
fContext->GetHistory()->SetMaxDepth(maxDepth);
}
void TextInput::SetHistoryPruneLength(size_t pruneLength) const
{
fContext->GetHistory()->SetPruneLength(pruneLength);
}
void
TextInput::AddHistoryLine(const char* line) {
if (!line) return;

View File

@ -84,6 +84,8 @@ namespace textinput {
void ReleaseInputOutput() const;
// History interface
void SetHistoryMaxDepth(size_t maxDepth) const;
void SetHistoryPruneLength(size_t pruneLength) const;
bool IsAutoHistAddEnabled() const { return fAutoHistAdd; }
void EnableAutoHistAdd(bool enable = true) { fAutoHistAdd = enable; }
void AddHistoryLine(const char* line);