aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--text.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/text.c b/text.c
index 7f94247..bf597da 100644
--- a/text.c
+++ b/text.c
@@ -1517,7 +1517,7 @@ size_t text_pos_by_lineno(Text *txt, size_t lineno) {
cache->pos = lines_skip_forward(txt, 0, lineno - 1, &lines_skipped);
cache->lineno = lines_skipped + 1;
}
- return cache->pos;
+ return cache->lineno == lineno ? cache->pos : EPOS;
}
size_t text_lineno_by_pos(Text *txt, size_t pos) {