From cc23d266402d134f4159c21914b9b95b85aac8ff Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Sat, 26 Jan 2019 12:47:49 +0100 Subject: [PATCH] push add_history to readline history handler class --- aql2/src/prompt/HistoryRegister.h | 6 ++---- aql2/src/prompt/ReadlinePromptHistory.h | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/aql2/src/prompt/HistoryRegister.h b/aql2/src/prompt/HistoryRegister.h index c6ab8e8c6b..24912892a8 100644 --- a/aql2/src/prompt/HistoryRegister.h +++ b/aql2/src/prompt/HistoryRegister.h @@ -8,9 +8,7 @@ #ifndef _HISTORY_REGISTER_H_ #define _HISTORY_REGISTER_H_ -#include <alib/string> - -#include <readline/history.h> +#include "ReadlinePromptHistory.h" #include <lexer/Lexer.h> @@ -26,7 +24,7 @@ public: if ( m_allowHistory ) { std::string line = m_lexer.getLine ( ); ext::trim ( line ); - add_history ( line.c_str ( ) ); + ReadlinePromptHistory::addHistory ( line ); } } }; diff --git a/aql2/src/prompt/ReadlinePromptHistory.h b/aql2/src/prompt/ReadlinePromptHistory.h index 691fd99a0f..87d076bb93 100644 --- a/aql2/src/prompt/ReadlinePromptHistory.h +++ b/aql2/src/prompt/ReadlinePromptHistory.h @@ -86,6 +86,10 @@ public: write_history ( history_file.c_str ( ) ); } + static void addHistory ( const std::string & line ) { + add_history ( line.c_str ( ) ); + } + }; #endif /* _READLINE_PROMPT_HISTORY_H */ -- GitLab