vim-patch:8.2.0115: byte2line() does not work correctly with text properties

Problem:    Byte2line() does not work correctly with text properties. (Billie
            Cleek)
Solution:   Take the bytes of the text properties into account.
            (closes vim/vim#5334)

9df53b62de

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2025-08-11 00:57:01 -04:00
parent 750c350be8
commit 7048c36ba8

View File

@@ -4023,9 +4023,12 @@ int ml_find_line_or_offset(buf_T *buf, linenr_T lnum, int *offp, bool no_ff)
} }
} else { } else {
extra = 0; extra = 0;
while (offset >= size while (true) {
if (!(offset >= size
+ text_end - (int)((dp->db_index[idx]) & DB_INDEX_MASK) + text_end - (int)((dp->db_index[idx]) & DB_INDEX_MASK)
+ ffdos) { + ffdos)) {
break;
}
if (ffdos) { if (ffdos) {
size++; size++;
} }