1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:27:34 +00:00

LibLine: Rename LineEditor to Line::Editor

This commit is contained in:
Andreas Kling 2020-03-31 13:34:06 +02:00
parent a30a3277a3
commit 6595469de1
4 changed files with 30 additions and 22 deletions

View file

@ -38,20 +38,22 @@
#include <sys/stat.h>
#include <termios.h>
class LineEditor;
namespace Line {
class Editor;
struct KeyCallback {
KeyCallback(Function<bool(LineEditor&)> cb)
KeyCallback(Function<bool(Editor&)> cb)
: callback(move(cb))
{
}
Function<bool(LineEditor&)> callback;
Function<bool(Editor&)> callback;
};
class LineEditor {
class Editor {
public:
LineEditor();
~LineEditor();
Editor();
~Editor();
void initialize()
{
@ -72,7 +74,7 @@ public:
void add_to_history(const String&);
const Vector<String>& history() const { return m_history; }
void on_char_input(char ch, Function<bool(LineEditor&)> callback);
void on_char_input(char ch, Function<bool(Editor&)> callback);
Function<Vector<String>(const String&)> on_tab_complete_first_token = nullptr;
Function<Vector<String>(const String&)> on_tab_complete_other_token = nullptr;
@ -126,3 +128,5 @@ private:
bool m_initialized = false;
};
}