vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 74cbd167da39f45be581625a400815b5c1ba3a45 parent d87700f4589c6de880a5bc51db414b74214b72f8 Author: Marc André Tanner <mat@brain-dump.org> Date: Sun, 26 Jul 2020 17:37:29 +0200 vis: remove ie inner entire text object Diffstat:
| M | config.def.h | | | 1 | - |
| M | main.c | | | 6 | ------ |
| M | man/vis.1 | | | 3 | --- |
| M | text-objects.c | | | 13 | ------------- |
| M | text-objects.h | | | 2 | -- |
| M | vis-text-objects.c | | | 3 | --- |
| M | vis.h | | | 1 | - |
7 files changed, 0 insertions(+), 29 deletions(-)
diff --git a/config.def.h b/config.def.h @@ -118,7 +118,6 @@ static const KeyBinding bindings_textobjects[] = { { "i}", ALIAS("i{") }, { "ib", ALIAS("i(") }, { "iB", ALIAS("i{") }, - { "ie", ACTION(TEXT_OBJECT_ENTIRE_INNER) }, { "il", ACTION(TEXT_OBJECT_LINE_INNER) }, { "ip", ACTION(TEXT_OBJECT_PARAGRAPH) }, { "is", ACTION(TEXT_OBJECT_SENTENCE) }, diff --git a/main.c b/main.c @@ -305,7 +305,6 @@ enum { VIS_ACTION_TEXT_OBJECT_BACKTICK_OUTER, VIS_ACTION_TEXT_OBJECT_BACKTICK_INNER, VIS_ACTION_TEXT_OBJECT_ENTIRE_OUTER, - VIS_ACTION_TEXT_OBJECT_ENTIRE_INNER, VIS_ACTION_TEXT_OBJECT_LINE_OUTER, VIS_ACTION_TEXT_OBJECT_LINE_INNER, VIS_ACTION_TEXT_OBJECT_INDENTATION, @@ -1137,11 +1136,6 @@ static const KeyAction vis_action[] = { VIS_HELP("The whole text content") textobj, { .i = VIS_TEXTOBJECT_OUTER_ENTIRE } }, - [VIS_ACTION_TEXT_OBJECT_ENTIRE_INNER] = { - "vis-textobject-entire-inner", - VIS_HELP("The whole text content, except for leading and trailing empty lines") - textobj, { .i = VIS_TEXTOBJECT_INNER_ENTIRE } - }, [VIS_ACTION_TEXT_OBJECT_LINE_OUTER] = { "vis-textobject-line-outer", VIS_HELP("The whole line") diff --git a/man/vis.1 b/man/vis.1 @@ -1029,9 +1029,6 @@ matches the last used search term in backward direction .It Ic ae entire file content . -.It Ic ie -entire file content except for leading and trailing empty lines -. .It Ic al current line . diff --git a/text-objects.c b/text-objects.c @@ -15,19 +15,6 @@ Filerange text_object_entire(Text *txt, size_t pos) { return text_range_new(0, text_size(txt)); } -Filerange text_object_entire_inner(Text *txt, size_t pos) { - char c; - Filerange r = text_object_entire(txt, pos); - Iterator it = text_iterator_get(txt, r.start); - if (text_iterator_byte_get(&it, &c) && c == '\n') - while (text_iterator_byte_next(&it, &c) && c == '\n'); - r.start = it.pos; - it = text_iterator_get(txt, r.end); - while (text_iterator_char_prev(&it, &c) && c == '\n'); - r.end = it.pos; - return text_range_linewise(txt, &r); -} - static Filerange text_object_customword(Text *txt, size_t pos, int (*isboundary)(int)) { Filerange r; char c, prev = '0', next = '0'; diff --git a/text-objects.h b/text-objects.h @@ -11,8 +11,6 @@ /* return range covering the entire text */ Filerange text_object_entire(Text*, size_t pos); -/* entire document except leading and trailing empty lines */ -Filerange text_object_entire_inner(Text*, size_t pos); /* word which happens to be at pos without any neighbouring white spaces */ Filerange text_object_word(Text*, size_t pos); /* includes trailing white spaces. if at pos happens to be a white space diff --git a/vis-text-objects.c b/vis-text-objects.c @@ -176,9 +176,6 @@ const TextObject vis_textobjects[] = { [VIS_TEXTOBJECT_OUTER_ENTIRE] = { .txt = text_object_entire, }, - [VIS_TEXTOBJECT_INNER_ENTIRE] = { - .txt = text_object_entire_inner, - }, [VIS_TEXTOBJECT_OUTER_LINE] = { .txt = text_object_line, }, diff --git a/vis.h b/vis.h @@ -623,7 +623,6 @@ enum VisTextObject { VIS_TEXTOBJECT_OUTER_BACKTICK, VIS_TEXTOBJECT_INNER_BACKTICK, VIS_TEXTOBJECT_OUTER_ENTIRE, - VIS_TEXTOBJECT_INNER_ENTIRE, VIS_TEXTOBJECT_OUTER_LINE, VIS_TEXTOBJECT_INNER_LINE, VIS_TEXTOBJECT_INDENTATION,