Improve highlighting structure
- switched to a sparse delta based map - true lazy-loading to avoid any unneccessary allocations - fixed windows management api
This commit is contained in:
@@ -3,24 +3,22 @@
|
||||
|
||||
#include "ruby/decl.h"
|
||||
#include "syntax/decl.h"
|
||||
#include "syntax/line_tree.h"
|
||||
#include "syntax/line_map.h"
|
||||
|
||||
struct Parser {
|
||||
struct Editor *editor = nullptr;
|
||||
std::string lang;
|
||||
std::shared_ptr<void> (*parse_func)(std::vector<Token> *tokens,
|
||||
std::shared_ptr<void> in_state,
|
||||
const char *text, uint32_t len,
|
||||
uint32_t line_num);
|
||||
bool (*state_match_func)(std::shared_ptr<void> state_1,
|
||||
std::shared_ptr<void> state_2);
|
||||
std::unique_ptr<StateBase> (*parse_func)(std::vector<Token> *tokens,
|
||||
StateBase *in_state,
|
||||
const char *text, uint32_t len,
|
||||
uint32_t line_num);
|
||||
bool (*state_match_func)(StateBase *state_1, StateBase *state_2);
|
||||
mrb_value parser_block = mrb_nil_value();
|
||||
mrb_value match_block = mrb_nil_value();
|
||||
bool is_custom{false};
|
||||
std::atomic<uint32_t> scroll_max{0};
|
||||
std::atomic<bool> scroll_dirty{false};
|
||||
LineTree line_tree;
|
||||
UniqueQueue<uint32_t> dirty_lines;
|
||||
LineMap line_map = LineMap();
|
||||
|
||||
Parser(Editor *editor, std::string n_lang, uint32_t n_scroll_max);
|
||||
void edit(uint32_t start_line, uint32_t removed_rows, uint32_t inserted_rows);
|
||||
|
||||
Reference in New Issue
Block a user