Major update

- Add an IO system to hijack a bit of the terminal.
- Other minor fixes.
This commit is contained in:
2026-08-22 22:57:18 +01:00
parent 1f3b53753a
commit 3563324a1c
13 changed files with 621 additions and 43 deletions
+16 -1
View File
@@ -4,11 +4,25 @@
#include "internal/buffer/buffer.h"
#include "internal/commands/commands.h"
#include "internal/commands/suffixes.h"
#include "internal/io/io.h"
#include "internal/marks/marks.h"
#include "internal/theme/theme.h"
#include "pch.h"
namespace bed {
struct Suggestion {
enum : uint8_t {
Command,
Address,
Suffix,
History,
Regex
} type;
std::string_view name;
std::string_view desc;
std::string completion;
};
struct BEd {
internal::trie::Trie<internal::commands::Command> commands;
internal::commands::Command no_op;
@@ -16,6 +30,7 @@ struct BEd {
std::array<std::optional<internal::commands::Suffix>, 26> suffixes;
internal::theme::Theme theme;
std::unordered_map<std::string, internal::syntax::Language> languages;
internal::io::IO &io;
bool help_mode = false;
std::string last_help = "";
@@ -27,7 +42,7 @@ struct BEd {
std::unordered_map<std::string, internal::buffer::Buffer *> buffers;
internal::buffer::Buffer *active;
BEd(std::vector<std::string> args);
BEd(std::vector<std::string> args, internal::io::IO &io);
~BEd();
void handle(std::string_view cmd, bool eof);
void run();