aboutsummaryrefslogtreecommitdiff
path: root/text-motions.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-25 19:19:05 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-25 19:19:05 +0200
commit62682f0d351890f3050b3251d5d26448bf922109 (patch)
treeea2b813f71abe6713308fe1a4675520b79e1247b /text-motions.h
parent334e7f278f18889582c51bd9aceb469e716cddea (diff)
downloadvis-62682f0d351890f3050b3251d5d26448bf922109.tar.gz
vis-62682f0d351890f3050b3251d5d26448bf922109.tar.xz
Add infrastructure for word (lowercase) motions
This unfortunately doesn't work as is which is why it is not actually hooked up to key bindings.
Diffstat (limited to 'text-motions.h')
-rw-r--r--text-motions.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/text-motions.h b/text-motions.h
index e182e2e..eb6ae8f 100644
--- a/text-motions.h
+++ b/text-motions.h
@@ -35,8 +35,8 @@ size_t text_line_lastchar(Text*, size_t pos);
size_t text_line_end(Text*, size_t pos);
size_t text_line_next(Text*, size_t pos);
/*
- * A word consists of a sequence of non-blank characters, separated with white
- * space. TODO?: An empty line is also considered to be a word.
+ * A longword consists of a sequence of non-blank characters, separated with
+ * white space. TODO?: An empty line is also considered to be a word.
* This is equivalant to a WORD in vim terminology.
*/
size_t text_longword_end_next(Text*, size_t pos);
@@ -44,14 +44,15 @@ size_t text_longword_end_prev(Text*, size_t pos);
size_t text_longword_start_next(Text*, size_t pos);
size_t text_longword_start_prev(Text*, size_t pos);
/*
- * These are variants of the above with the additional possibility to implement
- * a custom word detection logic. Can be used to implment the equivalent of a
- * what vim reconizes as a word (lowercase).
+ * A word consists of a sequence of letters, digits and underscores, or a
+ * sequence of other non-blank characters, separated with white space.
+ * TODO?: An empty line is also considered to be a word.
+ * This is equivalant to a word (lowercase) in vim terminology.
*/
-size_t text_word_boundry_end_next(Text*, size_t pos, int (*isboundry)(int));
-size_t text_word_boundry_end_prev(Text*, size_t pos, int (*isboundry)(int));
-size_t text_word_boundry_start_next(Text*, size_t pos, int (*isboundry)(int));
-size_t text_word_boundry_start_prev(Text*, size_t pos, int (*isboundry)(int));
+size_t text_word_end_next(Text*, size_t pos);
+size_t text_word_end_prev(Text*, size_t pos);
+size_t text_word_start_next(Text*, size_t pos);
+size_t text_word_start_prev(Text*, size_t pos);
/* TODO: implement the following semantics
* A sentence is defined as ending at a '.', '!' or '?' followed by either the
* end of a line, or by a space or tab. Any number of closing ')', ']', '"'