Add support for > and >> prompts with new readline

This commit is contained in:
2023-05-18 22:09:54 -04:00
parent eb43c99f47
commit d3c4c0801d
9 changed files with 47 additions and 9 deletions

View File

@@ -19,8 +19,9 @@ private:
CodepointString current_prompt_;
char32_t readline_lastc_;
void echo_command();
void erase_command();
void echo_command();
public:
ReadlineDevice();
@@ -30,6 +31,7 @@ public:
// change the prompt.
void set_prompt(const CodepointString &prompt);
void set_prompt_utf8(const std::string &prompt);
// Use this to print anything on the console.
void print(const CodepointString &cps);
@@ -44,8 +46,9 @@ public:
static std::string to_utf8(const CodepointString &cps);
// This can be used to convert UTF8 to a codepoint string.
// Some of the bytes may not be consumed. Returns the Codepoint
// string and the number of bytes consumed.
// Some of the bytes may not be consumed, if the source contains
// a partial utf-8 sequence. Returns the Codepoint string and the
// number of bytes consumed.
static CodepointString from_utf8(std::string_view source, int *consumed);
};