aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-05-31 13:07:51 -0600
committernytpu <alex@nytpu.com>2021-05-31 13:07:51 -0600
commitecda2b07ad1baa472b64db7a789ad85a91cc9621 (patch)
tree1e3b45915920b8982d370d1e0ac89f6cebbb64f8 /common.h
parentfixup makefile (diff)
downloaded-ecda2b07ad1baa472b64db7a789ad85a91cc9621.tar.bz2
ed-ecda2b07ad1baa472b64db7a789ad85a91cc9621.zip
add RowNum define
Diffstat (limited to 'common.h')
-rw-r--r--common.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/common.h b/common.h
index b1ff70e..535ae6b 100644
--- a/common.h
+++ b/common.h
@@ -24,21 +24,23 @@
// default to 80 columns
#define DEFAULT_WIDTH 80
+typedef long RowNum;
+
struct Row {
- long idx; // Row number (zero-based)
+ RowNum idx; // Row number (zero-based)
int size; // Size of row (including trailing \n\0)
char *chars; // Row content
};
// doubles as an editor state/editor config struct as well
struct Buffer {
- long crow; // current row address
+ RowNum crow; // current row address
int scols; // number of columns we can display on screen
char *filename;
bool dirty; // has the buffer been modified since last write?
- long numrows;
+ RowNum numrows;
struct Row *rows;
const char *last_err; // verbose error message for last error that occurred