summaryrefslogtreecommitdiff
path: root/src/dged
diff options
context:
space:
mode:
Diffstat (limited to 'src/dged')
-rw-r--r--src/dged/buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dged/buffer.c b/src/dged/buffer.c
index 733d4a4..89e7dad 100644
--- a/src/dged/buffer.c
+++ b/src/dged/buffer.c
@@ -579,6 +579,8 @@ struct location buffer_clamp(struct buffer *buffer, int64_t line, int64_t col) {
location.line = buffer_num_lines(buffer) - 1;
location.col = buffer_num_chars(buffer, location.line);
}
+ } else if (line < 0) {
+ return location;
} else {
location.line = line;
uint32_t nchars = buffer_num_chars(buffer, location.line);