diff options
Diffstat (limited to 'vis-text-objects.c')
| -rw-r--r-- | vis-text-objects.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vis-text-objects.c b/vis-text-objects.c index a4fe36f..14f299d 100644 --- a/vis-text-objects.c +++ b/vis-text-objects.c @@ -9,6 +9,14 @@ void vis_textobject(Vis *vis, enum VisTextObject id) { } } +static Filerange search_forward(Vis *vis, Text *txt, size_t pos) { + return text_object_search_forward(txt, pos, vis->search_pattern); +} + +static Filerange search_backward(Vis *vis, Text *txt, size_t pos) { + return text_object_search_backward(txt, pos, vis->search_pattern); +} + TextObject vis_textobjects[] = { [VIS_TEXTOBJECT_INNER_WORD] = { .txt = text_object_word }, [VIS_TEXTOBJECT_OUTER_WORD] = { .txt = text_object_word_outer }, @@ -36,5 +44,7 @@ TextObject vis_textobjects[] = { [VIS_TEXTOBJECT_INNER_FUNCTION] = { .txt = text_object_function_inner, }, [VIS_TEXTOBJECT_OUTER_LINE] = { .txt = text_object_line, }, [VIS_TEXTOBJECT_INNER_LINE] = { .txt = text_object_line_inner, }, + [VIS_TEXTOBJECT_SEARCH_FORWARD] = { .vis = search_forward, .type = SPLIT }, + [VIS_TEXTOBJECT_SEARCH_BACKWARD] = { .vis = search_backward, .type = SPLIT }, }; |
