summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index f7bc0e3..ef86c32 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -389,6 +389,10 @@ bool maybe_delete_region(struct buffer *buffer) {
}
void buffer_kill_line(struct buffer *buffer) {
+ if (text_num_lines(buffer->text) == 0) {
+ return;
+ }
+
uint32_t nchars =
text_line_length(buffer->text, buffer->dot.line) - buffer->dot.col;
if (nchars == 0) {