From 2bfffb448d980b4de5a1fd964299449a8650aa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 5 Mar 2017 11:11:18 +0100 Subject: text-object: remove C implementation of file name text object This is no longer needed now that the completion logic was moved to Lua. --- text-objects.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'text-objects.c') diff --git a/text-objects.c b/text-objects.c index ff35849..fee8235 100644 --- a/text-objects.c +++ b/text-objects.c @@ -255,33 +255,6 @@ Filerange text_object_backtick(Text *txt, size_t pos) { return text_object_bracket(txt, pos, '`'); } -Filerange text_object_range(Text *txt, size_t pos, int (*isboundary)(int)) { - char c; - size_t start; - Iterator it = text_iterator_get(txt, pos), rit = it; - if (!text_iterator_byte_get(&rit, &c) || boundary(c)) - return text_range_empty(); - char tmp = c; - do start = rit.pos; while (text_iterator_char_prev(&rit, &c) && !boundary(c)); - for (c = tmp; !boundary(c) && text_iterator_byte_next(&it, &c);); - return text_range_new(start, it.pos); -} - -static int is_filename_boundary(int c) { - switch (c) { - case ';': case ':': case '|': - case '"': case '\'': case '`': - case '<': case '>': - return true; - default: - return isspace(c); - } -} - -Filerange text_object_filename(Text *txt, size_t pos) { - return text_object_range(txt, pos, is_filename_boundary); -} - Filerange text_object_search_forward(Text *txt, size_t pos, Regex *regex) { size_t start = pos; size_t end = text_size(txt); -- cgit v1.2.3