Add wide character support (tabs/emojis) and other minor fixes
This commit is contained in:
@@ -107,15 +107,13 @@ Editor *new_editor(const char *filename, Coord position, Coord size);
|
||||
void free_editor(Editor *editor);
|
||||
void render_editor(Editor *editor);
|
||||
void fold(Editor *editor, uint32_t start_line, uint32_t end_line);
|
||||
void scroll_up(Editor *editor, uint32_t lines);
|
||||
void scroll_down(Editor *editor, uint32_t lines);
|
||||
void cursor_up(Editor *editor, uint32_t number);
|
||||
void cursor_down(Editor *editor, uint32_t number);
|
||||
void cursor_left(Editor *editor, uint32_t number);
|
||||
void cursor_right(Editor *editor, uint32_t number);
|
||||
void ensure_scroll(Editor *editor);
|
||||
void apply_edit(std::vector<Span> &spans, uint32_t x, int64_t y);
|
||||
void edit_erase(Editor *editor, uint32_t pos, uint32_t len);
|
||||
void edit_erase(Editor *editor, uint32_t pos, int64_t len);
|
||||
void edit_insert(Editor *editor, uint32_t pos, char *data, uint32_t len);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,6 @@ typedef struct LineIterator {
|
||||
Knot *node;
|
||||
uint8_t top;
|
||||
uint32_t offset;
|
||||
uint32_t line;
|
||||
Knot *stack[64];
|
||||
} LineIterator;
|
||||
|
||||
@@ -116,7 +115,7 @@ LineIterator *begin_l_iter(Knot *root, uint32_t start_line);
|
||||
// After getting the necessary lines free the iterator (no need to go upto the
|
||||
// end) returns null if there are no more lines All return strings `must` be
|
||||
// freed by the caller
|
||||
char *next_line(LineIterator *it);
|
||||
char *next_line(LineIterator *it, uint32_t *out_len);
|
||||
|
||||
// Used to start an iterator over leaf data
|
||||
// root is the root of the rope
|
||||
|
||||
@@ -46,10 +46,6 @@
|
||||
#define CNTRL_ALT 3
|
||||
#define SHIFT 4
|
||||
|
||||
const char VS16_BYTE_A = '\xEF';
|
||||
const char VS16_BYTE_B = '\xB8';
|
||||
const char VS16_BYTE_C = '\x8F';
|
||||
|
||||
enum CellFlags : uint8_t {
|
||||
CF_NONE = 0,
|
||||
CF_ITALIC = 1 << 0,
|
||||
@@ -86,9 +82,6 @@ extern std::vector<ScreenCell> old_screen;
|
||||
extern std::mutex screen_mutex;
|
||||
extern std::atomic<bool> running;
|
||||
|
||||
void get_terminal_size();
|
||||
void enable_raw_mode();
|
||||
void disable_raw_mode();
|
||||
Coord start_screen();
|
||||
void end_screen();
|
||||
void update(uint32_t row, uint32_t col, const char *utf8, uint32_t fg,
|
||||
@@ -100,6 +93,4 @@ Coord get_size();
|
||||
int read_input(char *buf, size_t buflen);
|
||||
KeyEvent read_key();
|
||||
|
||||
int display_width(const char *str);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,9 +36,11 @@ struct Coord {
|
||||
uint32_t col;
|
||||
};
|
||||
|
||||
uint32_t visual_width(const char *s);
|
||||
uint32_t get_visual_col_from_bytes(const char *line, uint32_t byte_limit);
|
||||
uint32_t get_bytes_from_visual_col(const char *line,
|
||||
// std::vector<uint32_t> visual_width(const char *s, uint32_t max_width);
|
||||
int display_width(const char *str, size_t len);
|
||||
uint32_t get_visual_col_from_bytes(const char *line, uint32_t len,
|
||||
uint32_t byte_limit);
|
||||
uint32_t get_bytes_from_visual_col(const char *line, uint32_t len,
|
||||
uint32_t target_visual_col);
|
||||
void log(const char *fmt, ...);
|
||||
std::string get_exe_dir();
|
||||
|
||||
Reference in New Issue
Block a user