diff options
author | cflip <cflip@cflip.net> | 2023-01-08 14:15:01 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-08 14:15:01 -0700 |
commit | 91195d34e1f71246cadc41705004d66ab647087e (patch) | |
tree | 0d2f7e929b7b51590d270e2f22fb5a3621204bf2 /row.h |
Initial import of existing source code
This is based off of snaptoken's "Build Your Own Text Editor" tutorial
at https://viewsourcecode.org/snaptoken/kilo/.
Diffstat (limited to 'row.h')
-rw-r--r-- | row.h | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,27 @@ +#pragma once + +#include <ctype.h> + +#include "editor.h" + +#define TAB_WIDTH 4 + +struct editor_row { + int index; + int size; + char* chars; + int render_size; + char* render; + unsigned char* highlight; + int highlight_open_comment; +}; + +int row_x_to_display_x(struct editor_row* row, int x); +int row_display_x_to_x(struct editor_row* row, int display_x); +void update_row(struct editor_state* editor, struct editor_row* row); +void insert_row(struct editor_state* editor, int at, char* string, size_t length); +void free_row(struct editor_row* row); +void delete_row(struct editor_state* editor, int at); +void row_insert_char(struct editor_state* editor, struct editor_row* row, int at, int c); +void row_append_string(struct editor_state* editor, struct editor_row* row, char* string, size_t length); +void row_delete_char(struct editor_state* editor, struct editor_row* row, int at); |