aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-12-22 15:56:39 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-12-22 18:13:01 +0100
commit25f5a92cd32d62b3c8496af9083e8222c858efaf (patch)
tree5473d3631daf51d85bc4917176de42a3f1b08d3b
parentc6d76158b597d6c9bcfe222129d2897fececc45f (diff)
downloadvis-25f5a92cd32d62b3c8496af9083e8222c858efaf.tar.gz
vis-25f5a92cd32d62b3c8496af9083e8222c858efaf.tar.xz
text: remove Filepos typedef
The idea might be good, but it was almost unused.
-rw-r--r--text.h2
-rw-r--r--view.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/text.h b/text.h
index fbd06b9..b8ec0e1 100644
--- a/text.h
+++ b/text.h
@@ -14,8 +14,6 @@ typedef uintptr_t Mark;
#define EMARK ((Mark)0) /* invalid mark */
#define EPOS ((size_t)-1) /* invalid position */
-typedef size_t Filepos;
-
typedef struct {
size_t start, end; /* range in bytes from start of the file */
} Filerange;
diff --git a/view.c b/view.c
index 126e9f7..b9e47a6 100644
--- a/view.c
+++ b/view.c
@@ -48,7 +48,7 @@ struct Selection {
};
struct Cursor { /* cursor position */
- Filepos pos; /* in bytes from the start of the file */
+ size_t pos; /* in bytes from the start of the file */
int row, col; /* in terms of zero based screen coordinates */
int lastcol; /* remembered column used when moving across lines */
Line *line; /* screen line on which cursor currently resides */
@@ -71,8 +71,8 @@ struct View {
Text *text; /* underlying text management */
UiWin *ui;
int width, height; /* size of display area */
- Filepos start, end; /* currently displayed area [start, end] in bytes from the start of the file */
- Filepos start_last; /* previously used start of visible area, used to update the mark */
+ size_t start, end; /* currently displayed area [start, end] in bytes from the start of the file */
+ size_t start_last; /* previously used start of visible area, used to update the mark */
Mark start_mark; /* mark to keep track of the start of the visible area */
size_t lines_size; /* number of allocated bytes for lines (grows only) */
Line *lines; /* view->height number of lines representing view content */