frontend: update bluelib api usage

This commit is contained in:
2025-11-06 10:39:08 +00:00
parent 9622e30e0f
commit 24eef25147
10 changed files with 50 additions and 39 deletions

View File

@@ -36,16 +36,16 @@ struct hl_range *get_hl_range(struct line_ed *ed, size_t x, size_t y)
struct hl_range *best_match = NULL;
b_queue_iterator it;
b_queue_foreach (&it, &ed->l_hl_ranges) {
struct hl_range *cur = b_unbox(struct hl_range, it.entry, h_entry);
b_queue_entry *entry = b_queue_first(&ed->l_hl_ranges);
while (entry) {
struct hl_range *cur = b_unbox(struct hl_range, entry, h_entry);
int cmp_end = compare_coords(x, y, cur->h_end_x, cur->h_end_y);
if (cmp_end == 1) {
continue;
if (cmp_end != 1) {
return cur;
}
return cur;
entry = b_queue_next(entry);
}
return NULL;
@@ -276,10 +276,11 @@ void line_ed_clear_highlights(struct line_ed *ed)
void line_ed_print_highlights(struct line_ed *ed)
{
b_queue_iterator it;
b_queue_foreach (&it, &ed->l_hl_ranges) {
struct hl_range *h = b_unbox(struct hl_range, it.entry, h_entry);
b_queue_entry *entry = b_queue_first(&ed->l_hl_ranges);
while (entry) {
struct hl_range *h = b_unbox(struct hl_range, entry, h_entry);
printf("(%zu, %zu) -> (%zu, %zu)\n", h->h_start_x, h->h_start_y,
h->h_end_x, h->h_end_y);
entry = b_queue_next(entry);
}
}