Skip to content

Commit

Permalink
Simplify text_object_line implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Sep 17, 2014
1 parent e9a8029 commit 3469424
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions text-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,9 @@ Filerange text_object_word(Text *txt, size_t pos) {
}

Filerange text_object_line(Text *txt, size_t pos) {
char c;
Filerange r;
r.start = text_line_begin(txt, pos);
Iterator it = text_iterator_get(txt, text_line_end(txt, pos));
if (text_iterator_byte_get(&it, &c) && c == '\n')
text_iterator_byte_next(&it, NULL);
if (text_iterator_byte_get(&it, &c) && c == '\r')
text_iterator_byte_next(&it, NULL);
r.end = it.pos;
r.end = text_line_next(txt, pos);
return r;
}

Expand Down

0 comments on commit 3469424

Please sign in to comment.