32 lines
736 B
C++
32 lines
736 B
C++
#pragma once
|
|
|
|
#include "internal/syntax/miniparser.h"
|
|
#include "pch.h"
|
|
|
|
namespace bed::internal::ui::text_mode {
|
|
struct TextMode {
|
|
struct Row {
|
|
uint64_t start;
|
|
uint64_t length;
|
|
};
|
|
using Lines = std::vector<Row>;
|
|
vase::Shard *vase;
|
|
vase::Point cursor;
|
|
std::optional<syntax::MiniParser> parser;
|
|
std::vector<Lines> lines;
|
|
uint16_t start;
|
|
uint16_t height;
|
|
uint16_t term_height;
|
|
uint16_t term_width;
|
|
BEd &bed;
|
|
|
|
TextMode(BEd &, vase::Shard *, syntax::Language *, void *);
|
|
std::pair<vase::Shard *, bool> run();
|
|
std::pair<vase::Shard *, bool> run_pipe();
|
|
std::pair<vase::Shard *, bool> run_terminal();
|
|
void grow();
|
|
void redraw();
|
|
void layout_lines();
|
|
};
|
|
} // namespace bed::internal::ui::text_mode
|