Major updates:

- A lotta cleanup
- BEd command parser rewrite
- Vase class removed
- Proper IO system.
- A lot more.
This commit is contained in:
2026-08-29 22:30:01 +01:00
parent d7278251ec
commit b8eac7b2da
42 changed files with 2153 additions and 1733 deletions
+19 -20
View File
@@ -2,35 +2,25 @@
#include "definitions.h"
#include "internal/buffer/buffer.h"
#include "internal/commands/commands.h"
#include "internal/commands/suffixes.h"
#include "internal/functions/functions.h"
#include "internal/functions/suffixes.h"
#include "internal/io/command.h"
#include "internal/io/io.h"
#include "internal/marks/marks.h"
#include "internal/theme/theme.h"
#include "internal/ui/autocomp.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;
internal::commands::Command eof_op;
std::array<std::optional<internal::commands::Suffix>, 26> suffixes;
internal::trie::Trie<internal::functions::Function> functions;
internal::functions::Function no_op;
internal::functions::Function eof_op;
std::array<std::optional<internal::functions::Suffix>, 26> suffixes;
internal::theme::Theme theme;
std::unordered_map<std::string, internal::syntax::Language> languages;
internal::io::IO &io;
internal::vase::AppendStorage append{"/tmp"};
bool help_mode = false;
std::string last_help = "";
@@ -38,12 +28,21 @@ struct BEd {
std::function<std::string(BEd &)> prompt = nullptr;
bool suppress_mode = false;
std::string last_regex = "";
std::string last_symbol = "";
std::string last_replacement = "";
std::unordered_map<std::string, internal::buffer::Buffer *> buffers;
internal::buffer::Buffer *active;
internal::buffer::Range prev;
internal::marks::MarksEngine marks;
BEd(std::vector<std::string> args, internal::io::IO &io);
~BEd();
internal::buffer::Buffer &buffer(const std::string &);
internal::buffer::Line &current();
void mark(char, internal::buffer::Line);
void handle(std::string_view cmd, bool eof);
void run();
void suffix_handle(char s);