summaryrefslogtreecommitdiffstats
path: root/sinksh/repl/replStates.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sinksh/repl/replStates.cpp')
-rw-r--r--sinksh/repl/replStates.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/sinksh/repl/replStates.cpp b/sinksh/repl/replStates.cpp
index c4b08b7..38ebdf2 100644
--- a/sinksh/repl/replStates.cpp
+++ b/sinksh/repl/replStates.cpp
@@ -24,14 +24,14 @@
24#include <QDebug> 24#include <QDebug>
25#include <QEvent> 25#include <QEvent>
26#include <QStateMachine> 26#include <QStateMachine>
27#include "linenoise.hpp"
28 27
28#include "commandline.h"
29#include "syntaxtree.h" 29#include "syntaxtree.h"
30 30
31ReadState::ReadState(QState *parent) 31ReadState::ReadState(QState *parent)
32 : QState(parent) 32 : QState(parent)
33{ 33{
34 linenoise::SetCompletionCallback([](const char* editBuffer, std::vector<std::string>& completions) { 34 Commandline::setCompletionCallback([](const char* editBuffer, std::vector<std::string>& completions) {
35 QStringList words = QString(editBuffer).split(" ", QString::SkipEmptyParts); 35 QStringList words = QString(editBuffer).split(" ", QString::SkipEmptyParts);
36 const QString fragment = words.takeLast(); 36 const QString fragment = words.takeLast();
37 Syntax::List nearest = SyntaxTree::self()->nearestSyntax(words, fragment); 37 Syntax::List nearest = SyntaxTree::self()->nearestSyntax(words, fragment);
@@ -56,7 +56,7 @@ void ReadState::onEntry(QEvent *event)
56 Q_UNUSED(event) 56 Q_UNUSED(event)
57 57
58 std::string line; 58 std::string line;
59 if (linenoise::Readline(prompt(), line)) { 59 if (Commandline::readline(prompt(), line)) {
60 std::cout << std::endl; 60 std::cout << std::endl;
61 emit exitRequested(); 61 emit exitRequested();
62 return; 62 return;
@@ -66,7 +66,7 @@ void ReadState::onEntry(QEvent *event)
66 const QString text = QString::fromStdString(line).simplified(); 66 const QString text = QString::fromStdString(line).simplified();
67 67
68 if (text.length() > 0) { 68 if (text.length() > 0) {
69 linenoise::AddHistory(line.c_str()); 69 Commandline::addHistory(line);
70 } 70 }
71 71
72 emit command(text); 72 emit command(text);