diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-08-31 11:07:01 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-08-31 11:07:01 +0200 |
| commit | fbaeffb469d2fd6833a1301255f1ac73c7226a83 (patch) | |
| tree | 16f635303aba7fc69a74c69c61bb79c168f70531 /text-objects.c | |
| parent | 0ce017c2b813177eb425c0030852c140a662f800 (diff) | |
| download | vis-fbaeffb469d2fd6833a1301255f1ac73c7226a83.tar.gz vis-fbaeffb469d2fd6833a1301255f1ac73c7226a83.tar.xz | |
Expose various text objects with individual functions
Diffstat (limited to 'text-objects.c')
| -rw-r--r-- | text-objects.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/text-objects.c b/text-objects.c index 1ac0395..4063992 100644 --- a/text-objects.c +++ b/text-objects.c @@ -55,7 +55,7 @@ Filerange text_object_paragraph(Text *txt, size_t pos) { return r; } -Filerange text_object_bracket(Text *txt, size_t pos, char type) { +static Filerange text_object_bracket(Text *txt, size_t pos, char type) { char c, open, close; int opened = 1, closed = 1; @@ -105,3 +105,31 @@ Filerange text_object_bracket(Text *txt, size_t pos, char type) { return empty; return r; } + +Filerange text_object_square_bracket(Text *txt, size_t pos) { + return text_object_bracket(txt, pos, ']'); +} + +Filerange text_object_curly_bracket(Text *txt, size_t pos) { + return text_object_bracket(txt, pos, '}'); +} + +Filerange text_object_angle_bracket(Text *txt, size_t pos) { + return text_object_bracket(txt, pos, '>'); +} + +Filerange text_object_paranthese(Text *txt, size_t pos) { + return text_object_bracket(txt, pos, ')'); +} + +Filerange text_object_quote(Text *txt, size_t pos) { + return text_object_bracket(txt, pos, '"'); +} + +Filerange text_object_single_quote(Text *txt, size_t pos) { + return text_object_bracket(txt, pos, '\''); +} + +Filerange text_object_backtick(Text *txt, size_t pos) { + return text_object_bracket(txt, pos, '`'); +} |
