mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
osc8: uri ranges: use a dynamically re-sizable array instead of a tllist
This commit is contained in:
parent
b1043a72f8
commit
ccee08a393
4 changed files with 319 additions and 123 deletions
15
url-mode.c
15
url-mode.c
|
|
@ -439,24 +439,27 @@ osc8_uris(const struct terminal *term, enum url_action action, url_list_t *urls)
|
|||
|
||||
for (int r = 0; r < term->rows; r++) {
|
||||
const struct row *row = grid_row_in_view(term->grid, r);
|
||||
const struct row_data *extra = row->extra;
|
||||
|
||||
if (row->extra == NULL)
|
||||
if (extra == NULL)
|
||||
continue;
|
||||
|
||||
tll_foreach(row->extra->uri_ranges, it) {
|
||||
for (size_t i = 0; i < extra->uri_ranges.count; i++) {
|
||||
const struct row_uri_range *range = &extra->uri_ranges.v[i];
|
||||
|
||||
struct coord start = {
|
||||
.col = it->item.start,
|
||||
.col = range->start,
|
||||
.row = r + term->grid->view,
|
||||
};
|
||||
struct coord end = {
|
||||
.col = it->item.end,
|
||||
.col = range->end,
|
||||
.row = r + term->grid->view,
|
||||
};
|
||||
tll_push_back(
|
||||
*urls,
|
||||
((struct url){
|
||||
.id = it->item.id,
|
||||
.url = xstrdup(it->item.uri),
|
||||
.id = range->id,
|
||||
.url = xstrdup(range->uri),
|
||||
.start = start,
|
||||
.end = end,
|
||||
.action = action,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue