From d625e8c12de02e2c39d687b735e6e8d5a3fd0865 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Wed, 24 Jul 2013 09:18:08 +0200 Subject: Actually adding history this time. --- src/Readline.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Readline.cc') diff --git a/src/Readline.cc b/src/Readline.cc index ad324ee..9a2c791 100644 --- a/src/Readline.cc +++ b/src/Readline.cc @@ -6,7 +6,9 @@ using namespace Balau; Readline::Readline(const String & program, IO in) : m_in(in) { + HistEvent ev; m_hist = history_init(); + history(m_hist, &ev, H_SETSIZE, 5000); m_el = el_init(program.to_charp(), stdin, stdout, stderr); el_set(m_el, EL_CLIENTDATA, this); el_set(m_el, EL_PROMPT, (const char * (*)(EditLine *)) &Readline::elPrompt); @@ -33,6 +35,11 @@ String Readline::gets() { return ""; } + if (*line) { + HistEvent ev; + history(m_hist, &ev, H_ENTER, line); + } + return line; } -- cgit v1.2.3