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:
+9
-7
@@ -1,15 +1,19 @@
|
||||
#include "io/sysio.h"
|
||||
|
||||
namespace io {
|
||||
std::vector<ScreenCell> new_screen;
|
||||
static uint32_t rows, cols;
|
||||
static bool show_cursor = 0;
|
||||
static std::vector<ScreenCell> old_screen;
|
||||
static termios orig_termios;
|
||||
uint32_t rows, cols;
|
||||
bool show_cursor = 0;
|
||||
std::vector<ScreenCell> old_screen;
|
||||
termios orig_termios;
|
||||
} // namespace io
|
||||
|
||||
using namespace io;
|
||||
|
||||
void disable_raw_mode() {
|
||||
std::string os = "\x1b[?1049l\x1b[2 q\x1b[?1002l\x1b[?25h\x1b[?2004l";
|
||||
write(STDOUT_FILENO, os.c_str(), os.size());
|
||||
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios) == -1) {
|
||||
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &io::orig_termios) == -1) {
|
||||
perror("tcsetattr");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@@ -45,8 +49,6 @@ Coord start_screen() {
|
||||
|
||||
void end_screen() { disable_raw_mode(); }
|
||||
|
||||
Coord get_size() { return {rows, cols}; }
|
||||
|
||||
void io_render() {
|
||||
static bool first_render = true;
|
||||
uint32_t current_fg = 0;
|
||||
|
||||
Reference in New Issue
Block a user