Fix tab offset

This commit is contained in:
Matúš Púll 2025-05-28 13:16:54 +02:00
parent f8e0a06a62
commit 99c3e8cc0c

View file

@ -153,7 +153,7 @@ count_type Treap::get_tab_offset(position p) {
string line = get_line(p.r, false);
for(count_type i = 0; i + tab_offset < p.c; ++i) {
if(line[i] == '\t')
tab_offset += ((i+tab_offset-1) % TAB_SIZE);
tab_offset += TAB_SIZE - (i+tab_offset) % TAB_SIZE - 1;
if(i + tab_offset > p.c)
tab_offset -= i + tab_offset - p.c;
}