aboutsummaryrefslogtreecommitdiff
path: root/text-objects.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-25 18:09:43 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-25 18:19:02 +0200
commit334e7f278f18889582c51bd9aceb469e716cddea (patch)
tree6d3df455c9bddb4ae71a3851f9d3d3d2a82cbc47 /text-objects.c
parent4e60bd39282651d83d7b431239225b1371419b21 (diff)
downloadvis-334e7f278f18889582c51bd9aceb469e716cddea.tar.gz
vis-334e7f278f18889582c51bd9aceb469e716cddea.tar.xz
Perform some renames in preparation for different word types
Diffstat (limited to 'text-objects.c')
-rw-r--r--text-objects.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/text-objects.c b/text-objects.c
index 0c819ac..c37c233 100644
--- a/text-objects.c
+++ b/text-objects.c
@@ -29,29 +29,29 @@ Filerange text_object_word(Text *txt, size_t pos) {
text_iterator_byte_next(&it, &next);
if (isspace(c)) {
/* middle of two words, include leading white space */
- r.start = text_char_next(txt, text_word_end_prev(txt, pos));
- r.end = text_char_next(txt, text_word_end_next(txt, pos));
+ r.start = text_char_next(txt, text_longword_end_prev(txt, pos));
+ r.end = text_char_next(txt, text_longword_end_next(txt, pos));
} else if (isspace(prev) && isspace(next)) {
/* on a single character */
r.start = pos;
- r.end = text_word_start_next(txt, pos);
+ r.end = text_longword_start_next(txt, pos);
} else if (isspace(prev)) {
/* at start of a word */
r.start = pos;
- r.end = text_word_start_next(txt, text_word_end_next(txt, pos));
+ r.end = text_longword_start_next(txt, text_longword_end_next(txt, pos));
} else if (isspace(next)) {
/* at end of a word */
- r.start = text_word_start_prev(txt, pos);
- r.end = text_word_start_next(txt, pos);
+ r.start = text_longword_start_prev(txt, pos);
+ r.end = text_longword_start_next(txt, pos);
} else {
/* in the middle of a word */
- r.start = text_word_start_prev(txt, pos);
- r.end = text_word_start_next(txt, text_word_end_next(txt, pos));
+ r.start = text_longword_start_prev(txt, pos);
+ r.end = text_longword_start_next(txt, text_longword_end_next(txt, pos));
}
return r;
}
-Filerange text_object_word_raw(Text *txt, size_t pos) {
+Filerange text_object_longword_raw(Text *txt, size_t pos) {
char c, prev = '0', next = '0';
Filerange r = text_range_empty();
Iterator it = text_iterator_get(txt, pos);
@@ -69,15 +69,15 @@ Filerange text_object_word_raw(Text *txt, size_t pos) {
} else if (isspace(prev)) {
/* at start of a word */
r.start = pos;
- r.end = text_char_next(txt, text_word_end_next(txt, pos));
+ r.end = text_char_next(txt, text_longword_end_next(txt, pos));
} else if (isspace(next)) {
/* at end of a word */
- r.start = text_word_start_prev(txt, pos);
+ r.start = text_longword_start_prev(txt, pos);
r.end = text_char_next(txt, pos);
} else {
/* in the middle of a word */
- r.start = text_word_start_prev(txt, pos);
- r.end = text_char_next(txt, text_word_end_next(txt, pos));
+ r.start = text_longword_start_prev(txt, pos);
+ r.end = text_char_next(txt, text_longword_end_next(txt, pos));
}
return r;