diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-03-13 10:45:43 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-03-13 10:45:43 +0100 |
| commit | 46cb07d97cee20b49dcca809e45046cd506bc251 (patch) | |
| tree | d7ec0d797c627cacdd38f24df122a8ede995e687 /vis-text-objects.c | |
| parent | 3ffd4e783c17bcd90820da297b9a2c3c7766df95 (diff) | |
| download | vis-46cb07d97cee20b49dcca809e45046cd506bc251.tar.gz vis-46cb07d97cee20b49dcca809e45046cd506bc251.tar.xz | |
vis: convert gn and gN text objects to use "/ register content
Diffstat (limited to 'vis-text-objects.c')
| -rw-r--r-- | vis-text-objects.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/vis-text-objects.c b/vis-text-objects.c index ebb7384..962c22c 100644 --- a/vis-text-objects.c +++ b/vis-text-objects.c @@ -31,11 +31,21 @@ bool 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); + Filerange range = text_range_empty(); + Regex *regex = vis_regex(vis, NULL); + if (regex) + range = text_object_search_forward(txt, pos, regex); + text_regex_free(regex); + return range; } static Filerange search_backward(Vis *vis, Text *txt, size_t pos) { - return text_object_search_backward(txt, pos, vis->search_pattern); + Filerange range = text_range_empty(); + Regex *regex = vis_regex(vis, NULL); + if (regex) + range = text_object_search_backward(txt, pos, regex); + text_regex_free(regex); + return range; } const TextObject vis_textobjects[] = { |
