1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

LibLine: Read configuration from a config file

This commit is contained in:
AnotherTest 2020-08-17 19:13:52 +04:30 committed by Andreas Kling
parent afbeb8f977
commit d0aab41628
3 changed files with 35 additions and 4 deletions

View file

@ -78,6 +78,8 @@ struct Configuration {
void set(RefreshBehaviour refresh) { refresh_behaviour = refresh; }
void set(OperationMode mode) { operation_mode = mode; }
static Configuration from_config(const StringView& libname = "line");
RefreshBehaviour refresh_behaviour { RefreshBehaviour::Lazy };
OperationMode operation_mode { OperationMode::Unset };
};
@ -178,7 +180,7 @@ public:
const Utf32View buffer_view() const { return { m_buffer.data(), m_buffer.size() }; }
private:
explicit Editor(Configuration configuration = {});
explicit Editor(Configuration configuration = Configuration::from_config());
enum VTState {
Free = 1,
@ -365,8 +367,10 @@ private:
HashMap<char, NonnullOwnPtr<KeyCallback>> m_key_callbacks;
// TODO: handle signals internally.
struct termios m_termios {};
struct termios m_default_termios {};
struct termios m_termios {
};
struct termios m_default_termios {
};
bool m_was_interrupted { false };
bool m_was_resized { false };