#pragma once #include "definitions.h" #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 commands; internal::commands::Command no_op; internal::commands::Command eof_op; std::array, 26> suffixes; internal::theme::Theme theme; std::unordered_map languages; internal::io::IO &io; bool help_mode = false; std::string last_help = ""; bool prompt_mode = true; std::function prompt = nullptr; bool suppress_mode = false; std::string last_regex = ""; std::unordered_map buffers; internal::buffer::Buffer *active; BEd(std::vector args, internal::io::IO &io); ~BEd(); void handle(std::string_view cmd, bool eof); void run(); void suffix_handle(char s); }; } // namespace bed