aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'text.c')
-rw-r--r--text.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/text.c b/text.c
index fdcf1cf..650f095 100644
--- a/text.c
+++ b/text.c
@@ -504,6 +504,8 @@ static void change_free(Change *c) {
* \-+ <-- +-----+ <-- +---------------+ <-- +-/
*/
bool text_insert(Text *txt, size_t pos, const char *data, size_t len) {
+ if (len == 0)
+ return true;
if (pos > txt->size)
return false;
if (pos < txt->lines.pos)