vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 61e234bcbd19d5f820f7279500daf7b53fb2037e parent eced4f4c9051c00762921ea538227f7407218ac2 Author: Marc André Tanner <mat@brain-dump.org> Date: Thu, 14 Aug 2014 21:26:50 +0200 Remove useless replace API The removed junk might not have the same length as the newly inserted one. Diffstat:
| M | text.c | | | 10 | ---------- |
| M | text.h | | | 2 | -- |
2 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/text.c b/text.c @@ -756,16 +756,6 @@ bool text_delete(Text *ed, size_t pos, size_t len) { return true; } -bool text_replace_raw(Text *ed, size_t pos, const char *data, size_t len) { - if (!text_delete(ed, pos, len)) - return false; - return text_insert_raw(ed, pos, data, len); -} - -bool text_replace(Text *ed, size_t pos, const char *data) { - return text_replace_raw(ed, pos, data, strlen(data)); -} - /* preserve the current text content such that it can be restored by * means of undo/redo operations */ void text_snapshot(Text *ed) { diff --git a/text.h b/text.h @@ -21,8 +21,6 @@ const char *text_filename(Text*); bool text_insert(Text*, size_t pos, const char *data); bool text_insert_raw(Text*, size_t pos, const char *data, size_t len); bool text_delete(Text*, size_t pos, size_t len); -bool text_replace(Text*, size_t pos, const char *data); -bool text_replace_raw(Text*, size_t pos, const char *data, size_t len); void text_snapshot(Text*); bool text_undo(Text*); bool text_redo(Text*);