aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-07-22 21:09:32 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-07-22 21:09:32 +0200
commiteea17f2c606cb5f233f9809cbc7e4c84ad538052 (patch)
tree230f66be78821b4977b8d736892cb3105d0e999e
parentd55fb0318ce00cd52510be98ebcf8cf6857c0a96 (diff)
downloadvis-eea17f2c606cb5f233f9809cbc7e4c84ad538052.tar.gz
vis-eea17f2c606cb5f233f9809cbc7e4c84ad538052.tar.xz
Reindent comments
-rw-r--r--editor.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/editor.c b/editor.c
index b7e850a..a2d8b96 100644
--- a/editor.c
+++ b/editor.c
@@ -35,18 +35,22 @@ struct Buffer {
*/
typedef struct Piece Piece;
struct Piece {
- Editor *editor; /* editor to which this piece belongs */
- Piece *prev, *next; /* pointers to the logical predecessor/successor */
- Piece *global_prev, *global_next; /* double linked list in order of allocation, used to free individual pieces */
- const char *data; /* pointer into a Buffer holding the data */
- size_t len; /* the lenght in number of bytes starting from content */
+ Editor *editor; /* editor to which this piece belongs */
+ Piece *prev, *next; /* pointers to the logical predecessor/successor */
+ Piece *global_prev; /* double linked list in order of allocation, */
+ Piece *global_next; /* used to free individual pieces */
+ const char *data; /* pointer into a Buffer holding the data */
+ size_t len; /* the lenght in number of bytes starting from content */
+ int index; /* unique index identifiying the piece */
// size_t line_count;
- int index; /* unique index identifiying the piece */
};
+/* used to transform a global position (byte offset starting from the begining
+ * of the text) into an offset relative to piece.
+ */
typedef struct {
- Piece *piece;
- size_t off;
+ Piece *piece; /* piece holding the location */
+ size_t off; /* offset into the piece in bytes */
} Location;
/* A Span holds a certain range of pieces. Changes to the document are allways