Skip to content

Commit

Permalink
text: fix bug in line break caching logic
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed May 7, 2016
1 parent b0343e1 commit e399562
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion text.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "text.h"
#include "text-util.h"
#include "text-motions.h"
#include "util.h"

/* Allocate buffers holding the actual file content in junks of size: */
Expand Down Expand Up @@ -1623,7 +1624,7 @@ size_t text_lineno_by_pos(Text *txt, size_t pos) {
} else if (pos > cache->pos) {
cache->lineno += lines_count(txt, cache->pos, pos - cache->pos);
}
cache->pos = pos;
cache->pos = text_line_begin(txt, pos);
return cache->lineno;
}

Expand Down

0 comments on commit e399562

Please sign in to comment.