aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorNick Hanley <nicholasjhanley@gmail.com>2022-11-16 13:28:50 -0500
committerFelix Van der Jeugt <felix.vanderjeugt@posteo.net>2022-11-29 22:09:43 +0100
commitde8e3bb7b6fedc0554cee20834001dd4a739cd88 (patch)
treeae49efb024ab687e7af52149b42df7be1d31192c /text.c
parent8a420ecc4c1ed50111464ec66901bd983eaf2dbd (diff)
downloadvis-de8e3bb7b6fedc0554cee20834001dd4a739cd88.tar.gz
vis-de8e3bb7b6fedc0554cee20834001dd4a739cd88.tar.xz
fix miscellaneous spelling mistakes
Diffstat (limited to 'text.c')
-rw-r--r--text.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/text.c b/text.c
index 8f91e27..491170f 100644
--- a/text.c
+++ b/text.c
@@ -57,7 +57,7 @@ typedef struct Change Change;
struct Change {
Span old; /* all pieces which are being modified/swapped out by the change */
Span new; /* all pieces which are introduced/swapped in by the change */
- size_t pos; /* absolute position at which the change occured */
+ size_t pos; /* absolute position at which the change occurred */
Change *next; /* next change which is part of the same revision */
Change *prev; /* previous change which is part of the same revision */
};
@@ -120,7 +120,7 @@ static Revision *revision_alloc(Text *txt);
static void revision_free(Revision *rev);
/* logical line counting cache */
static void lineno_cache_invalidate(LineCache *cache);
-static size_t lines_skip_forward(Text *txt, size_t pos, size_t lines, size_t *lines_skiped);
+static size_t lines_skip_forward(Text *txt, size_t pos, size_t lines, size_t *lines_skipped);
static size_t lines_count(Text *txt, size_t pos, size_t len);
/* stores the given data in a block, allocates a new one if necessary. Returns
@@ -335,7 +335,7 @@ static Location piece_get_intern(Text *txt, size_t pos) {
return (Location){ 0 };
}
-/* similiar to piece_get_intern but usable as a public API. Returns the piece
+/* similar to piece_get_intern but usable as a public API. Returns the piece
* holding the text at byte offset pos. Never returns a sentinel piece.
* it pos is the end of file (== text_size()) and the file is not empty then
* the last piece holding data is returned.
@@ -388,7 +388,7 @@ static void change_free(Change *c) {
/* When inserting new data there are 2 cases to consider.
*
- * - in the first the insertion point falls into the middle of an exisiting
+ * - in the first the insertion point falls into the middle of an existing
* piece which is replaced by three new pieces:
*
* /-+ --> +---------------+ --> +-\
@@ -401,7 +401,7 @@ static void change_free(Change *c) {
* | | | existing| |demo | |text | | |
* \-+ <-- +---------+ <-- +-----+ <-- +-----+ <-- +-/
*
- * - the second case deals with an insertion point at a piece boundry:
+ * - the second case deals with an insertion point at a piece boundary:
*
* /-+ --> +---------------+ --> +-\
* | | | existing text | | |