fix: simplify Buffer.del_chars to use only byte offsets

This is a much faster implementation avoids duplicating work done by
Buffer.get_range. Buffer.get_range also does not have the bug reported
in #83.

The test case was also updated to reflect that get_chars now uses bytes,
instead of columns.

closes #83
This commit is contained in:
CJ van den Berg 2024-12-19 22:36:40 +01:00
parent 5d5b157295
commit f134fdb747
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 40 additions and 43 deletions

View file

@ -292,7 +292,7 @@ test "del_chars_with_tab_issue83" {
defer a.free(line3);
defer a.free(line4);
break :blk line2.len + 1 +
line3.len + 7 + 1 +
line3.len + 1 +
line4.len + 1;
};